New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken class Signature in GenTraversableFactory #4789
Comments
Imported From: https://issues.scala-lang.org/browse/SI-4789?orig=1 |
@dcsobral said: |
@gkossakowski said: |
@hubertp said: |
@paulp said: public class J<CC> {
public class Inner { }
}
class K<CC> {
// (LJ<TCC;>.Inner;)V;
public void f(J<CC>.Inner param) { }
} The example with javac fails because GenTraversableFactory$ReusableCBF$ // this exists And indeed the accessor is pointing at the one which doesn't exist: private volatile scala.collection.generic.GenTraversableFactory$ReusableCBF$ ReusableCBF$module; Changing it to a lazy val fixes it not because the signature changes but because GenTraversableFactory$ReusableCBF is generated. |
@paulp said: |
@hubertp said: |
@paulp said: |
@gkossakowski said: import scala.collection.immutable.RedBlack;
public class Test {} and you'll get following error message: I believe there is other kind of broken signature (probably unrelated to this ticket) but it's hard to check it until this issue is fixed. |
@paulp said: |
@gkossakowski said: https://scala-webapps.epfl.ch/jenkins/view/Misc/job/scala-signatures/ Will post update specific to this issue and will keep general discussion on internals mailing list. |
@paulp said: |
@soc said: |
@paulp said: |
Commit Message Bot (anonymous) said: This commit fixes two major problems:
For details it's the best to check #4819, #4820 and First problem mentioned above was straightforward to The second one deserves more attention. From now, classes There's one caveat though: top level objects get two object A { class B } will be compiled into following classes: A, A$, A$B. Since non-top-level objects don't have a mirror class object A { object B { class C } } it's impossible to import C from Java. That's the tradeoff As a nice consequence of this change, we get better way to Fixes #4789 #4819 #4820 #4983 and possibly some Review by extempore, dragos. |
Commit r25230 reveals some problem in scalac that results in broken class signature emitted for GenTraversableFactory. As for now, scala library from trunk is completely unusable for Eclipse users.
In order to see the problem it's enough to create a following file in Eclipse:
Eclipse will complain about the first import with following error message:
Multiple markers at this line
- The class file GenTraversableFactory contains a signature '()Lscala/collection/generic/GenTraversableFactory<TCC;>.ReusableCBF;' ill-formed at
position 56
- The class file GenTraversableFactory contains a signature '()Lscala/collection/generic/GenTraversableFactory<TCC;>.ReusableCBF;' ill-formed at
position 56
A bit more involved example exposes this issue with javac:
so javac doesn't crash but fails to find a method that is defined in class file:
Iulian proposed following work-around:
I can confirm that it works.
The text was updated successfully, but these errors were encountered: