Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Typecheck ConstantAnnotations normally, not like Java annotations
So far we handled ConstantAnnotations the same as Java annotations. Instead of typechecking the full parse tree `Apply(New(annot), args)`, the `New` and the individual `args` were typed individually. This is needed for Java annotations as there's no corresponding constructor. But for ConstantAnnotations we can just type check them normally and then extract the constants.
- Loading branch information
Showing
9 changed files
with
96 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
nested-annotation.scala:8: error: nested classfile annotations must be defined in java; found: inline | ||
@ComplexAnnotation(new inline) def bippy(): Int = 1 | ||
^ | ||
1 error | ||
nested-annotation.scala:11: error: no arguments allowed for nullary constructor SuppressWarnings: (): SuppressWarnings | ||
@ComplexAnnotation(new SuppressWarnings(Array("blup"))) def huppy(): Int = 2 | ||
^ | ||
2 errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
t5182.scala:4: error: unknown annotation argument name: qwe | ||
@java.lang.Deprecated(qwe = "wer") def ok(q:Int) = 1 | ||
^ | ||
t5182.scala:5: error: arguments to Java annotations or subclasses of ConstantAnnotation have to be supplied as named arguments | ||
t5182.scala:5: error: arguments to Java annotations have to be supplied as named arguments | ||
@java.lang.Deprecated("wer") def whereAmI(q:Int) = 1 | ||
^ | ||
2 errors |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
new sann(1, scala.`package`.List.apply[Int](1, 2)) | ||
new jann(y = Array(1, 2), x = 2) | ||
new jann(x = 2, y = Array(1, 2)) |