private val/var in Trait are incorrectly exposed to JDT (the full mangled name should be used)
//Actor.scala
trait Actor {
private val processingBehavior = 2
}
//UntypedActor.scala
abstract class UntypedActor extends Actor
//JavaAPITestActor.java
public class JavaAPITestActor extends UntypedActor {
void asd() {
super.Actor$$processingBehavior();
}
}
When opening the JavaAPITestActor file, the following two errors are reported:
- The hierarchy of the type JavaAPITestActor is inconsistent
- The method Actor$$processingBehavior() is undefined for the type UntypedActor
There should be none...
Leave a comment
on 2011-11-17 15:49 *
By Mirco Dotta
Summary changed from Trait private val/var mangled names are not exposed to JDT to private val/var in Trait are incorrectly exposed to JDT (the full mangled name should be used)
on 2011-11-17 16:08 *
By Mirco Dotta
Summary changed from private val/var in Trait are incorrectly exposed to JDT (the full mangled name should be used) to hierarchy inconsistent: private val/var in Trait are incorrectly exposed to JDT (the full mangled name should be used)
It looks like the only way to obtain the mangled name is to run `atPhase(jvmPhase)(x.name)` in the compiler. Which we clearly can't, as we don't execute all the phases before jvmPhase, and the final mangling may depend on those unexecuted phases. Bottom line, I don't think we can have a clean fix for this at the moment.
on 2011-11-17 16:26 *
By Mirco Dotta
(In revision:9eb709e7fc320504236b81c7d9d9ababf1517108) Disabled test because it is making fail the build for 2.8 compiler.
As a matter of fact, it is really only by chance that with 2.9 the test is passing, and
a bigger issue is lying behind this test. Look at ticket Re #1000761. The problem is that
we are not correctly exposing to JDT private values defined in a trait , i.e., the exposed
getter does not match the name of the method in the binary, which is clearly an issue (for
instance, I'm pretty convinced that the spurious error The hierarchy of the type XXX is
inconsistent that can sometimes be shown in the Java editor, is likely to be linked to the
very same problem).
Since we plan a major re-work of the structure builder for 2.1 I believe it is better to tackle
this at that point. no review.
Branch: release/scala-ide-2.0.x
As a matter of fact, it is really only by chance that with 2.9 the test is passing, and
a bigger issue is lying behind this test. Look at ticket Re #1000761. The problem is that
we are not correctly exposing to JDT private values defined in a trait , i.e., the exposed
getter does not match the name of the method in the binary, which is clearly an issue (for
instance, I'm pretty convinced that the spurious error The hierarchy of the type XXX is
inconsistent that can sometimes be shown in the Java editor, is likely to be linked to the
very same problem).
Since we plan a major re-work of the structure builder for 2.1 I believe it is better to tackle
this at that point. no review.
Branch: release/scala-ide-2.0.x
on 2011-11-17 16:27 *
By Mirco Dotta
(In revision:377a5b626aa993a9c28fd766a88f8e9f95c5528f) Disabled test because it is making fail the build for 2.8 compiler.
As a matter of fact, it is really only by chance that with 2.9 the test is passing, and
a bigger issue is lying behind this test. Look at ticket Re #1000761. The problem is that
we are not correctly exposing to JDT private values defined in a trait , i.e., the exposed
getter does not match the name of the method in the binary, which is clearly an issue (for
instance, I'm pretty convinced that the spurious error The hierarchy of the type XXX is
inconsistent that can sometimes be shown in the Java editor, is likely to be linked to the
very same problem).
Since we plan a major re-work of the structure builder for 2.1 I believe it is better to tackle
this at that point. no review.
Branch: release/scala-ide-2.0.0
As a matter of fact, it is really only by chance that with 2.9 the test is passing, and
a bigger issue is lying behind this test. Look at ticket Re #1000761. The problem is that
we are not correctly exposing to JDT private values defined in a trait , i.e., the exposed
getter does not match the name of the method in the binary, which is clearly an issue (for
instance, I'm pretty convinced that the spurious error The hierarchy of the type XXX is
inconsistent that can sometimes be shown in the Java editor, is likely to be linked to the
very same problem).
Since we plan a major re-work of the structure builder for 2.1 I believe it is better to tackle
this at that point. no review.
Branch: release/scala-ide-2.0.0
on 2011-11-28 10:12 *
By Mirco Dotta
Summary changed from hierarchy inconsistent: private val/var in Trait are incorrectly exposed to JDT (the full mangled name should be used) to private val/var in Trait are incorrectly exposed to JDT (the full mangled name should be used)
on 2012-06-29 07:01 *
By Mirco Dotta
Version changed from 2.0.0-RC1-29 to 2.0.1-final-29
Eclipse version changed from Helios to Helios - Eclipse 3.6
Milestone changed from Helium to -none-
on 2015-03-13 12:15 *
By Simon Schäfer
Component changed from Eclipse to JDT integration
Eclipse version changed from Helios - Eclipse 3.6 to Luna - Eclipse 4.4
Version changed from 2.0.1-final-29 to 4.0.0
Assigned to changed from Mirco Dotta to -none-