-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
annots-constant-neg.check
96 lines (96 loc) · 4.22 KB
/
annots-constant-neg.check
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Test.scala:12: error: class Ann1 cannot have auxiliary constructors because it extends ConstantAnnotation
def this(s: String) = this(0) // err
^
Test.scala:14: error: class Ann2 needs to have exactly one argument list because it extends ConstantAnnotation
class Ann2(x: Int)(y: Int) extends ConstantAnnotation // err
^
Test.scala:25: error: annotation argument needs to be a constant; found: Test.this.nonConst
@JAnn(nonConst) def t3 = 0 // err
^
Test.scala:27: error: annotation JAnn is missing argument value
@JAnn() def t4 = 0 // err
^
Test.scala:30: error: arguments to Java annotations have to be supplied as named arguments
@JAnn(0, "") def t7 = 0 // err
^
Test.scala:30: error: arguments to Java annotations have to be supplied as named arguments
@JAnn(0, "") def t7 = 0 // err
^
Test.scala:30: error: annotation JAnn is missing argument value
@JAnn(0, "") def t7 = 0 // err
^
Test.scala:31: error: arguments to Java annotations have to be supplied as named arguments
@JAnn(0, a = "") def t8 = 0 // err
^
Test.scala:31: error: annotation JAnn is missing argument value
@JAnn(0, a = "") def t8 = 0 // err
^
Test.scala:34: error: annotation argument cannot be null
@JAnn(value = 0, a = null) def t10 = 0 // err
^
Test.scala:35: error: annotation argument needs to be a constant; found: Test.this.getClass()
@JAnn(value = 0, b = getClass) def t11 = 0 // err
^
Test.scala:36: error: Array constants have to be specified using the `Array(...)` factory method
@JAnn(value = 0, c = new Array(1)) def t12 = 0 // err
^
Test.scala:37: error: annotation argument cannot be null
@JAnn(value = 0, d = null) def t13 = 0 // err
^
Test.scala:38: error: annotation argument cannot be null
@JAnn(value = 0, d = null) def t14 = 0 // err
^
Test.scala:41: error: annotation argument needs to be a constant; found: java.lang.Integer.TYPE
@JAnn(value = 0, b = java.lang.Integer.TYPE) def t16 = 0 // err
^
Test.scala:45: error: annotation argument needs to be a constant; found: Test.this.nonConst
@Ann(nonConst) def u3 = 0 // err
^
Test.scala:47: error: not enough arguments for constructor Ann: (value: Int, a: String, b: Class[_], c: Array[Object]): Ann.
Unspecified value parameter value.
@Ann() def u4 = 0 // err
^
Test.scala:54: error: annotation argument cannot be null
@Ann(value = 0, a = null) def u10 = 0 // err
^
Test.scala:55: error: annotation argument needs to be a constant; found: Test.this.getClass()
@Ann(value = 0, b = getClass) def u11 = 0 // err
^
Test.scala:56: error: Array constants have to be specified using the `Array(...)` factory method
@Ann(value = 0, c = new Array(1)) def u12 = 0 // err
^
Test.scala:59: error: annotation argument needs to be a constant; found: java.lang.Integer.TYPE
@Ann(value = 0, b = java.lang.Integer.TYPE) def u16 = 0 // err
^
Test.scala:64: error: multiple constructors for Ann1 with alternatives:
(s: String)Ann1 <and>
(value: Int)Ann1
cannot be invoked with (x: String)
@Ann1(x = "") def v4 = 0 // err
^
Test.scala:66: error: Ann1 does not take parameters
@Ann1(0)(0) def v6 = 0 // err
^
Test.scala:67: error: not enough arguments for constructor Ann2: (x: Int)(y: Int): Ann2.
Unspecified value parameter x.
@Ann2 def v7 = 0 // err
^
Test.scala:68: error: missing argument list for constructor Ann2 in class Ann2
@Ann2(x = 0) def v8 = 0 // err
^
Test.scala:71: error: no arguments allowed for nullary constructor Ann3: (): Ann3
@Ann3(0) def v11 = 0 // err
^
Test.scala:72: error: not enough arguments for constructor Ann4: (x: Int, value: Int): Ann4.
Unspecified value parameter value.
@Ann4(0) def v12 = 0
^
Test.scala:78: error: no arguments allowed for nullary constructor Ann5: (): Ann5
@Ann5(0) def v18 = 0 // err
^
Test.scala:69: warning: Implementation limitation: multiple argument lists on annotations are
currently not supported; ignoring arguments List(0)
@Ann2(x = 0)(y = 0) def v9 = 0 // warn
^
1 warning
28 errors