* fix #6608
This commit is contained in:
flywind 2020-07-14 15:22:48 +08:00 • committed by GitHub
commit 086efac49b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View file

@ -955,8 +955,17 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode =
hasErrorType = true
break
if not hasErrorType:
let typ = n[0].typ
msg.add(">\nbut expected one of: \n" &
typeToString(n[0].typ))
typeToString(typ))
# prefer notin preferToResolveSymbols
# t.sym != nil
# sfAnon notin t.sym.flags
# 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))
localError(c.config, n.info, msg)
return errorNode(c, n)
result = nil