summary refs log tree commit diff stats
path: root/compiler/semobjconstr.nim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-05-16 10:03:22 -0700
committerGitHub <noreply@github.com>2021-05-16 10:03:22 -0700
commit3619a5a2aa1c7387ec7df01b195bc683943654ff (patch)
tree3c36ca5452ad58407b89c8244211bbe4f3608adf /compiler/semobjconstr.nim
parent65f6b6682027d030279d9aa5b0b6f9bbc3cf5123 (diff)
downloadNim-3619a5a2aa1c7387ec7df01b195bc683943654ff.tar.gz
more informative error msg for undeclared field (`A(badfield: 1)` and `a.badfield = expr`) (#17777)
Diffstat (limited to 'compiler/semobjconstr.nim')
-rw-r--r--compiler/semobjconstr.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/semobjconstr.nim b/compiler/semobjconstr.nim
index 6f3cabcbf..16e3c6cee 100644
--- a/compiler/semobjconstr.nim
+++ b/compiler/semobjconstr.nim
@@ -429,7 +429,8 @@ proc semObjConstr(c: PContext, n: PNode, flags: TExprFlags): PNode =
           hasError = true
           break
       # 2) No such field exists in the constructed type
-      localError(c.config, field.info, errUndeclaredFieldX % id.s)
+      let msg = errUndeclaredField % id.s & " for type " & getProcHeader(c.config, t.sym)
+      localError(c.config, field.info, msg)
       hasError = true
       break
 
Araq <rumpf_a@web.de> 2011-07-08 01:29:15 +0200 bugfix: 'set' overloadable; further steps for multi threading support' href='/ahoang/Nim/commit/compiler/ccgthreadvars.nim?h=devel&id=99bcc233cd8fb3bb9b6f3f0857e477dd9b33c9e8'>99bcc233c ^
6ddd4e6a3 ^
c3344862b ^

3ac6bd8ae ^
7e747d11c ^

1da98b163 ^
39049e151 ^
4fa80956b ^
1284827df ^
4fa80956b ^


5ad1acc60 ^

6d7ab08de ^
4fa80956b ^
7e747d11c ^
f500895ef ^

e11297492 ^




7e747d11c ^
6d7ab08de ^
39049e151 ^
4fa80956b ^
ca1f3f36b ^
5ad1acc60 ^
bc712c28f ^
7e747d11c ^
4fa80956b ^
2df9b442c ^
ca1f3f36b ^
9502e39b6 ^
57874ed9b ^
a585caebc ^
7e747d11c ^
a585caebc ^
39049e151 ^
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