File tree 6 files changed +32
-21
lines changed
testsuite/verona_nostdlib/issues/651
6 files changed +32
-21
lines changed Original file line number Diff line number Diff line change 1
- type Copyable[Self] = { // This loops forever due to parameter name self
2
- copy(self: Self) : Self
1
+ // Using reserved keyword in parameter and type parameter should result in errors.
2
+ type Copyable[Self] = {
3
+ copy(type: Self) : Self
3
4
} & (Self < Copyable[Self])
Original file line number Diff line number Diff line change 17
17
(ident 4:copy)
18
18
(paren
19
19
(group
20
- (ident 4:self)
20
+ (typealias
21
+ {})
21
22
(colon)
22
23
(Self)))
23
24
(colon)
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ modules
26
26
(ident 4:copy)
27
27
(paren
28
28
(group
29
- (ident 4:self)
29
+ (typealias
30
+ {})
30
31
(type
31
32
(Self))))
32
33
(type
Original file line number Diff line number Diff line change @@ -39,18 +39,19 @@ structure
39
39
(ident 7:trait$0)
40
40
(classbody
41
41
(function
42
- {
43
- self = param}
42
+ {}
44
43
(explicit)
45
44
(rhs)
46
45
(ident 4:copy)
47
46
(typeparams)
48
47
(params
49
- (param
50
- (ident 4:self)
51
- (type
52
- (Self))
53
- (dontcare)))
48
+ (error
49
+ (errormsg 20:Expected a parameter)
50
+ (group
51
+ (typealias
52
+ {})
53
+ (type
54
+ (Self)))))
54
55
(type
55
56
(Self))
56
57
(dontcare)
Original file line number Diff line number Diff line change @@ -39,18 +39,19 @@ structure
39
39
(ident 7:trait$0)
40
40
(classbody
41
41
(function
42
- {
43
- self = param}
42
+ {}
44
43
(explicit)
45
44
(rhs)
46
45
(ident 4:copy)
47
46
(typeparams)
48
47
(params
49
- (param
50
- (ident 4:self)
51
- (type
52
- (Self))
53
- (dontcare)))
48
+ (error
49
+ (errormsg 20:Expected a parameter)
50
+ (group
51
+ (typealias
52
+ {})
53
+ (type
54
+ (Self)))))
54
55
(type
55
56
(Self))
56
57
(dontcare)
Original file line number Diff line number Diff line change 1
1
Errors:
2
2
Expected a type parameter or a value parameter
3
- -- 651.verona:1 :15
4
- type Copyable[Self] = { // This loops forever due to parameter name self
3
+ -- 651.verona:2 :15
4
+ type Copyable[Self] = {
5
5
~~~~
6
6
7
- Pass structure failed with 1 error!
7
+ ----------------
8
+ Expected a parameter
9
+ -- 651.verona:3:8
10
+ copy(type: Self) : Self
11
+ ~~~~~~~~~~
12
+
13
+ Pass structure failed with 2 errors!
8
14
You can’t perform that action at this time.
0 commit comments