The Eclipse Scala editor reports bogus error compilation messages for valid code
Migrated from http://lampsvn.epfl.ch/trac/scala/ticket/2689
Reporter spiros
This happen when the code has compilation errors and the bogus error messages persist even if we fix the code and recompile.
How to trigger the bug # Create a file A.scala and save it to compile
Now if we uncomment the class C in file B.scala (to bring the code in a correct state again) and save the file to trigger a compilation, all the files get compiled, the error gets removed from the Problems View but the bogus error for class A still exists in the editor. To remove this bogus message we need to do again a Clean&Build.
I found this bug while investigating the bug outlined in this message and I suspect that they might be related.
Tested with Eclipse 3.5.1 and SDT r19784.
Reporter spiros
This happen when the code has compilation errors and the bogus error messages persist even if we fix the code and recompile.
How to trigger the bug # Create a file A.scala and save it to compile
//file: /bugs/A.scala
package bugs
class A
# Create a file B.scala with two classes B and C and save it to compile//file: /bugs/B.scala
package bugs
class B(a: A, c: C)
class C
# Comment out class C in B.scala and save the file (no error appears because of #2581)- Do a Clean and Build
Now if we uncomment the class C in file B.scala (to bring the code in a correct state again) and save the file to trigger a compilation, all the files get compiled, the error gets removed from the Problems View but the bogus error for class A still exists in the editor. To remove this bogus message we need to do again a Clean&Build.
I found this bug while investigating the bug outlined in this message and I suspect that they might be related.
Tested with Eclipse 3.5.1 and SDT r19784.
Leave a comment
on 2009-11-23 15:10 *
By tracImporter
Trac author: spiros
Attachment: file:errors-in-editors.png
Attachment: file:errors-in-editors.png
on 2009-11-23 15:11 *
By tracImporter
Trac author: spiros
Attachment: file:errors-in-view.png
Attachment: file:errors-in-view.png
on 2009-11-23 15:25 *
By
Thanks for that ... very helpful. I'll get a fix out ASAP (tho' probably not in time for tonight's nightly I'm afraid).
on 2009-11-23 15:44 *
By tracImporter
Trac author: spiros
OK no problem :-)
Using similar code I am able to reproduce the bug that we've talked about in the mailing list (see the link in the bug report) but not every time I do a clean. I will probably look at it again tomorrow but I believe that solving this bug might also solve the mailing list bug.
I am using the SDT 2.8 for some small personal projects and I have to say that I am very pleased with the progress you've made so far and I am confident that 2.8 will have a very good Eclipse plugin. So far my biggest pains are the various compiler problems (many of which are build manager related, see: #2581) and the lack of good code completion. When you finish with some annoying bugs it would be really helpful to start working on code completion again (I've noticed some improvements lately).
OK no problem :-)
Using similar code I am able to reproduce the bug that we've talked about in the mailing list (see the link in the bug report) but not every time I do a clean. I will probably look at it again tomorrow but I believe that solving this bug might also solve the mailing list bug.
I am using the SDT 2.8 for some small personal projects and I have to say that I am very pleased with the progress you've made so far and I am confident that 2.8 will have a very good Eclipse plugin. So far my biggest pains are the various compiler problems (many of which are build manager related, see: #2581) and the lack of good code completion. When you finish with some annoying bugs it would be really helpful to start working on code completion again (I've noticed some improvements lately).
on 2009-11-23 18:02 *
By tracImporter
Trac author: plocinic
The first part of the bug report is a duplicate of #2581.
The first part of the bug report is a duplicate of #2581.
on 2009-11-23 18:53 *
By tracImporter
Trac author: spiros
Hi plocinic,
I don't see any obvious similarities except that the steps that you have to take to reproduce this bug are a superset of the steps that reproduce #2581. The phrase "no error appears because of #2581" that appears in the bug report is there to prevent the developer from focusing on the anomaly that is created as a result of step 3 (missing error message) and focus on the anomaly that is the result of step 4 (bogus error message). Sorry If I am not clear enough and caused any confusion.
If this is not the case then please comment on how this bug and #2581 are related.
Hi plocinic,
I don't see any obvious similarities except that the steps that you have to take to reproduce this bug are a superset of the steps that reproduce #2581. The phrase "no error appears because of #2581" that appears in the bug report is there to prevent the developer from focusing on the anomaly that is created as a result of step 3 (missing error message) and focus on the anomaly that is the result of step 4 (bogus error message). Sorry If I am not clear enough and caused any confusion.
If this is not the case then please comment on how this bug and #2581 are related.
on 2009-11-23 20:23 *
By tracImporter
Trac author: spiros
Another way to trigger this bug:
In this example, in contrast with the example provided in the bug report, editing (adding whitespace) and saving C.scala removes the error message from the editor.
Another way to trigger this bug:
- Create and save a file A.scala like the following:
class A
class B
# Create and save a file C.scala like the following:class C {
val a: A = new B
}
B does not yet extend A so we correctly get a compilation error type mismatch; found : pack.B required: pack.A. Now if we change B to extend A and save A.scala the error message will get removed from the Problems View but not from the editor.In this example, in contrast with the example provided in the bug report, editing (adding whitespace) and saving C.scala removes the error message from the editor.
on 2009-11-24 11:56 *
By tracImporter
Trac author: spiros
Just realized that the bug that I've talked about in my last comment is probably a separate bug and can be triggered when:
I do not know if the two bug are separate since the bug in the report is triggered via Clean&Build and the bug in the comment is triggered via Save but they have the same consequence, invalid compilation messages in the editor.
Just realized that the bug that I've talked about in my last comment is probably a separate bug and can be triggered when:
- we introduce a compilation error in a file
- we save the file to compile
- edit and save another file to fix the issue (by adding a method for example)
I do not know if the two bug are separate since the bug in the report is triggered via Clean&Build and the bug in the comment is triggered via Save but they have the same consequence, invalid compilation messages in the editor.
on 2009-11-25 16:46 *
By tracImporter
Trac author: plocinic
Replying to spiros:
I must have been misguided by your point 3 and comment afterwards. This indeed looks to me like a bug in the editor, not in the builder.
Replying to spiros:
I must have been misguided by your point 3 and comment afterwards. This indeed looks to me like a bug in the editor, not in the builder.
on 2009-11-25 17:35 *
By
There might be multiple issues in play. I'll see if I can pinpoint what if anything is going wrong with the editor's reporting and/or the presentation compiler.
on 2009-11-28 09:46 *
By tracImporter
Trac author: misto
CC Change: me@…
CC Change: me@…
on 2010-01-07 14:59 *
By tracImporter
on 2010-01-07 14:59 *
By tracImporter
Closed As: fixed