-
Notifications
You must be signed in to change notification settings - Fork 21
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
Missing "ACC_BRIDGE, ACC_SYNTHETIC" in bytecode cause java could not compile #13075
Comments
As far as I can tell, your report only has Please clarify step by step how to reproduce the issue. Feel free to re-open. |
Perhaps you missed the |
@lrytz It seems like I don't have permission to reopen an issue. |
I made the same mistake when I looked at the other ticket. We need a better way to specify the reproduction. I'm not sure scala-cli directives suffice. |
@som-snytt If you are using IntelliJ Idea, reproduction will be easier. If you are referring to adding a test case in the compiler to reproduce, perhaps you can refer to Kotlin's test suite, which can simply put Kotlin and Java in the same file and use the test suite to reproduce the problem. I can give you some examples from Kotlin, such as this one. Kotlin's testing suite can parse comments in a single test file and read some configurations from it. |
Does Scala 3 handle it correctly? |
Yes, Scala 3 handle it correctly. You can see that compared to Scala 3, Scala 2 misses "ACC_BRIDGE, ACC_SYNTHETIC" in bytecode |
@SethTisue A possible off topic question, if Scala2 and Scala3 have the same bug, do I need to report it again here? |
Scala 3 has the flags but needs to get rid of them: |
A good place to ask questions like this is https://contributors.scala-lang.org If the bug is in the Scala 2 standard library (which Scala 3 incorporates as-is), you should report it to the Scala 2 tracker only, as that's where the bug will need to be fixed. For compiler bugs like this one... I can't really give unequivocal guidance. It's certainly considered legit to report it to both repos, if you crosslink the two tickets. But, I wouldn't automatically do it every time. I would normally suggest picking one repo or the other to start in, to confirm that the bug is actually a bug and to gauge the level of interest from maintainers and other users. Which repo to report to first? I don't know, my impression is that users generally just report it against whatever version they were using, since that's probably the version they care most about. Even if we tried to make rules about this, that's how users would go on behaving regardless :-) |
Reproduction steps
Scala version: 2.13.15
Problem
Java compiler reports error but no error in scala3:
A1.java:2: error: name clash: func(String) in A1 overrides a method whose erasure is the same as another method, yet neither overrides the other public void func(String arg) { ^ first method: func(Object) in A0 second method: func(T) in I1 where T is a type-variable: T extends Object declared in interface I1 1 error
use
javap -c -s -v
to viewA0.class
:func
ofA0
compiled by scala2 in javap outputfunc
ofA0
compiled by scala3 in javap outputWe can see that
A0.func
compiled by scala2 misses "ACC_BRIDGE, ACC_SYNTHETIC"The text was updated successfully, but these errors were encountered: