-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Dotty gets confused by raw types in bytecode signatures #3273
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
We can see what signature Dotty expects by removing the 6 |class SingleTestAnnotationTransformer(testName: String) extends IAnnotationTransformer {
| ^
|class SingleTestAnnotationTransformer needs to be abstract, since def transform:
| (x$0: org.testng.annotations.ITestAnnotation, x$1: Class, x$2:
| java.lang.reflect.Constructor
| , x$3: java.lang.reflect.Method): Unit is not defined Notice the missing type parameters for |
Can be reproduced by compiling interface Foo {
void foo(java.util.List list);
} and then class Test extends Foo {
override def foo(list: java.util.List[_]): Unit = ???
} |
I'm on it but it won't be trivial: we need to check for raw types in ClassfileParser which is hard to do without forcing too much things and getting into cycles. |
Would be nice to have a lazier |
@adriaanm Behold! https://github.com/lampepfl/dotty/blob/c50c16420b037268fe8e62bdd659e60ee2ceabfc/compiler/src/dotty/tools/dotc/core/SymDenotations.scala#L1897-L1903 My plan is in fact to see if I can use this for classfile loading too ;) |
Sigh. It's 14 years after Java generics came out and we still have to deal with raw types. 😢 This was one of the most messy aspects of nsc, basically impossibly to get right without forcing too much. |
It took me a while to realize: it's because of the change to native applied types. Before, it was convenient that the raw type |
It turned out to be a lot easier than for |
This doesn't currently cook raw types in parent position.
|
I've wanted to do the same thing in scalac, as it avoids spurious cycles. Here's what I tried: scala/scala#5308 I didn't pull the trigger because I was worried about the extra footprint needed by keeping the classfile bytes around for every Java class we touch (as is needed to facilitate deferred lookups to the constant pool). I plan to refactor There is some conceptual overlap with the JDK's signature archive, |
That would be very helpful. We should do something similar with Tasty files which suffer the same problem. |
Fix #3273: Extend cooking to parent types
Consider the following file
Test.scala
:Running
produces the following error:
The text was updated successfully, but these errors were encountered: