more informative error msg for undeclared field (A(badfield: 1) and a.badfield = expr) (#17777)
This commit is contained in:
parent
65f6b66820
commit
3619a5a2aa
3 changed files with 55 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue