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
Type member appears in java generic signature (this breaks graal native and won't make javac happy either) #15091
Labels
Milestone
Comments
arixmkii
added
itype:bug
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
May 3, 2022
The problem is that type members appear in generic type signatures: % javap MyInstances.class
Compiled from "i15091.scala"
public interface io.github.arixmkii.MyInstances {
public static io.github.arixmkii.MyTypes$Empty forWrappedF$(io.github.arixmkii.MyInstances);
public <F> io.github.arixmkii.MyTypes$Empty<io.github.arixmkii.MyTypes$WrappedFImpl.T> forWrappedF();
}
|
smarter
changed the title
kind-projector generate less reflective info than Scala 2 and fails with GraalVM native image
Type member appears in java generic signature (this breaks graal native and won't make javac happy either)
May 3, 2022
smarter
added
compat:java
and removed
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
May 3, 2022
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
May 3, 2022
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
May 3, 2022
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
May 3, 2022
- The PolyType case was dead code imported from Scala 2 - The HKTypeLambda case was correct for eta-expanded classes (e.g. in t7932 `Category[Tuple2]` should get as signature `Category<scala.Tuple2>`), but not for other type lambdas where it could lead to type members appearing in the signature. Fixed by splitting the case into an EtaExpansion case and a case for all other HKTypeLambdas (which are just replaced by a wildcard). Fixes scala#15091.
bishabosha
pushed a commit
to dotty-staging/dotty
that referenced
this issue
Oct 18, 2022
- The PolyType case was dead code imported from Scala 2 - The HKTypeLambda case was correct for eta-expanded classes (e.g. in t7932 `Category[Tuple2]` should get as signature `Category<scala.Tuple2>`), but not for other type lambdas where it could lead to type members appearing in the signature. Fixed by splitting the case into an EtaExpansion case and a case for all other HKTypeLambdas (which are just replaced by a wildcard). Fixes scala#15091.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.1.2
Minimized code
The full demo project (with compile and native image build for Scala 2 and 3) is here.
Output
It compiles with
scalac -unchecked -deprecation -feature -language:implicitConversions -Ykind-projector
, but when GraalVM native image build is called on the bytecode it results in exception:Expectation
Native image is generated successfully as it is for the same code with Scala 2.13.8 and old kind-projector plugin.
Additional notes
It is not clear if this is something, which should be addressed in dotty, but taking into account that native image is working on the generated bytecode it may be. If this is not for dotty team, then may be the team can add comments for GraalVM developers in this issue oracle/graal#4530 to help them.
Also, it is only my assumption that this is kind projector related as I didn't manage to minimize that code below, what is shown here.
The text was updated successfully, but these errors were encountered: