Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upScala compiler reports class file is broken when the class is annotated with a Java annotation having multiple enum values #5165
Comments
This comment has been minimized.
This comment has been minimized.
Imported From: https://issues.scala-lang.org/browse/SI-5165?orig=1
|
This comment has been minimized.
This comment has been minimized.
Alex Black (waterlooalex) said: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
George (gsward) said: |
This comment has been minimized.
This comment has been minimized.
George (gsward) said: |
This comment has been minimized.
This comment has been minimized.
@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 |
This comment has been minimized.
This comment has been minimized.
@paulp said: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Raman Gupta (rocketraman) said: |
This comment has been minimized.
This comment has been minimized.
@adriaanm said: |
scabug
closed this
Jan 29, 2014
This comment has been minimized.
This comment has been minimized.
@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 |
scabug commentedNov 7, 2011
•
edited by retronym
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: