@@ -2,38 +2,48 @@ discard """
22cmd: '''nim check --hints:off $file'''
33action: reject
44nimout: '''
5- tundeclared_field.nim(25, 12) Error: undeclared field: 'bad' for type tundeclared_field.A [type declared in tundeclared_field.nim(22, 8)]
6- tundeclared_field.nim(30, 16) Error: undeclared field: 'bad' for type tundeclared_field.A [type declared in tundeclared_field.nim(28, 8)]
7- tundeclared_field.nim(36, 4) Error: undeclared field: 'bad' for type tundeclared_field.A [type declared in tundeclared_field.nim(33, 8)]
8- tundeclared_field.nim(40, 13) Error: cannot instantiate Foo [type declared in tundeclared_field.nim(39, 8)]
5+ tundeclared_field.nim(25, 12) Error: undeclared field: 'bad1' for type tundeclared_field.A [type declared in tundeclared_field.nim(22, 8)]
6+ tundeclared_field.nim(30, 17) Error: undeclared field: 'bad2' for type tundeclared_field.A [type declared in tundeclared_field.nim(28, 8)]
7+ tundeclared_field.nim(36, 4) Error: undeclared field: 'bad3' for type tundeclared_field.A [type declared in tundeclared_field.nim(33, 8)]
8+ tundeclared_field.nim(42, 12) Error: undeclared field: 'bad4' for type tundeclared_field.B [type declared in tundeclared_field.nim(39, 8)]
9+ tundeclared_field.nim(43, 4) Error: undeclared field: 'bad5' for type tundeclared_field.B [type declared in tundeclared_field.nim(39, 8)]
10+ tundeclared_field.nim(44, 23) Error: undeclared field: 'bad6' for type tundeclared_field.B [type declared in tundeclared_field.nim(39, 8)]
11+ tundeclared_field.nim(46, 19) Error: undeclared field: 'bad7' for type tundeclared_field.B [type declared in tundeclared_field.nim(39, 8)]
12+ tundeclared_field.nim(50, 13) Error: cannot instantiate Foo [type declared in tundeclared_field.nim(49, 8)]
913'''
1014"""
1115
12-
13-
14-
15-
16-
17-
18-
19-
16+ #[
17+ xxx in future work, generic instantiations (e.g. `B[int]`) should be shown with their instantiation instead of `tundeclared_field.B`,
18+ maybe using TPreferedDesc.preferResolved or preferMixed
19+ ]#
2020# line 20
2121block :
2222 type A = object
2323 a0: int
2424 var a: A
25- discard a.bad
25+ discard a.bad1
2626
2727block :
2828 type A = object
2929 a0: int
30- var a = A (bad : 0 )
30+ var a = A (bad2 : 0 )
3131
3232block :
3333 type A = object
3434 a0: int
3535 var a: A
36- a.bad = 0
36+ a.bad3 = 0
37+
38+ block :
39+ type B[T] = object
40+ b0: int
41+ var b: B[int ]
42+ discard b.bad4
43+ b.bad5 = 0
44+ var b2 = B [int ](bad6: 0 )
45+ type Bi = B[int ]
46+ var b3 = Bi (bad7: 0 )
3747
3848block :
3949 type Foo [T: SomeInteger ] = object
0 commit comments