honor --declaredLocs in more places, including type mismatch errors; also show kind with --declaredLocs (#15673)
* honor --declaredLocs in more places, including type mismatch errors * fix tests * show declaration location also when type mismatch names clash
This commit is contained in:
parent
218acfe367
commit
0fb878324e
7 changed files with 40 additions and 24 deletions
|
|
@ -966,8 +966,9 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
|||
# t.kind != tySequence(It is tyProc)
|
||||
if typ.sym != nil and sfAnon notin typ.sym.flags and
|
||||
typ.kind == tyProc:
|
||||
msg.add(" = " &
|
||||
typeToString(typ, preferDesc))
|
||||
# when can `typ.sym != nil` ever happen?
|
||||
msg.add(" = " & typeToString(typ, preferDesc))
|
||||
msg.addDeclaredLocMaybe(c.config, typ)
|
||||
localError(c.config, n.info, msg)
|
||||
return errorNode(c, n)
|
||||
result = nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue