-
Notifications
You must be signed in to change notification settings - Fork 21
No Java Signature for mixed-in generic methods #3486
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
Comments
Imported From: https://issues.scala-lang.org/browse/SI-3486?orig=1 |
@dragos said: |
@adriaanm said: mixin clones members from the implementation class of a trait to add the forwarding members in the class that mixes in that trait the problem was that the members from the implementation class are also cloned (implClass in AddInterfaces) -- when a symbol is cloned, it loses its TypeHistory (only the info at cloning time is carried over), and thus the The first solution I tried was to have [http://github.com/adriaanm/scala/commit/0acbfe8b29c2055665630861f6fa5b473b3baeb2#diff-1 clone all entries in the type history] of a symbol -- that worked, but caused other subtle problems at other phases when compiling other code. The [http://github.com/adriaanm/scala/commit/dee5b264dc6ae771d73dd61dc16c367b1f40535e#diff-0 less invasive solution] that I now propose is twofold
|
@adriaanm said: fixed by having mixin do the cloning at the beginning of erasure and then updating the symbol's info to transform it to be valid in current phase review by odersky |
Here the thing I've found during exploration of Java complaining on generics in methods generated for specialization.
The problem also found with method generaited for trait implementation.
An example:
Scala:
Java:
java compiler (-Xlint:unckecked) complains about:
JD Java Decompiler shows that generated method is not generic:
The text was updated successfully, but these errors were encountered: