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
Scala compiler reports class file is broken when the class is annotated with a Java annotation having multiple enum values #5165
Comments
Imported From: https://issues.scala-lang.org/browse/SI-5165?orig=1
|
Alex Black (waterlooalex) said: |
Lorrin Nelson (lorrin) said: It seems to me that it is likely but unknown whether fixing #2764 will fix this. If we close this issue, there's no longer any trigger for someone to notice and confirm whether the issue has been resolved or not. So I'd prefer to leave open. |
George (gsward) said: |
George (gsward) said: |
@xeno-by said: TestTrait.scala:1: error: annotation argument needs to be a constant; found: TestAnnotation.TestEnumOne.A
@TestAnnotation(one=TestAnnotation.TestEnumOne.A, two=TestAnnotation.TestEnumTwo.C, strVal="something")
^
TestTrait.scala:1: error: annotation argument needs to be a constant; found: TestAnnotation.TestEnumTwo.C
@TestAnnotation(one=TestAnnotation.TestEnumOne.A, two=TestAnnotation.TestEnumTwo.C, strVal="something")
^
two errors found |
@paulp said: |
Raman Gupta (rocketraman) said: |
@adriaanm said: |
@retronym said:
Looks like this started working in:
I've submitted a test case to keep it fixed. This test case used the same compilation order as reported above: scala/scala#3548 |
I discovered this issues while annotating some of scala traits with Jackson type annotations (http://jackson.codehaus.org/1.9.0/javadoc/org/codehaus/jackson/annotate/JsonTypeInfo.html). The issues seems to be that the JsonTypeInfo annotation has two properties that reference inner non-static enumerations. The scala compiler appears to generate valid class files, but cannot load these class to compile other dependent source files.
I've managed to reproduce the issue outside of Jackson:
The source (also attached):
Other Observations:
The text was updated successfully, but these errors were encountered: