File tree 3 files changed +17
-1
lines changed
compiler/src/dotty/tools/dotc/core/classfile
3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -661,7 +661,7 @@ class ClassfileParser(
661
661
val constr = ctx.newSymbol(
662
662
owner = classRoot.symbol,
663
663
name = nme.CONSTRUCTOR ,
664
- flags = Flags .Synthetic | Flags .JavaDefined ,
664
+ flags = Flags .Synthetic | Flags .JavaDefined | Flags . Method ,
665
665
info = constrType
666
666
).entered
667
667
for ((attr, i) <- attrs.zipWithIndex)
Original file line number Diff line number Diff line change
1
+ // instantiating java annotations should not be allowed
2
+ // (would fail at runtime with java.lang.InstantiationError)
3
+ // see tests/pos/i5690.scala
4
+ object AnnotInst {
5
+ def main (a : Array [String ]) = {
6
+ new java.lang.annotation.Inherited // error
7
+ }
8
+ }
Original file line number Diff line number Diff line change
1
+ // TODO: this should be a compilation error
2
+ // program fails at runtime with java.lang.InstantiationError
3
+ // see tests/pending/neg/i5690.scala
4
+ object AnnotInst {
5
+ def main (a : Array [String ]) = {
6
+ new java.lang.annotation.Inherited
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments