mitigates #21272; but it's not the final fix because the first round … (#21462)

mitigates #21272; but it's not the final fix because the first round of overload resolution should already match

(cherry picked from commit f7e3af0c2d)
This commit is contained in:
Andreas Rumpf
2023-03-20 22:53:13 +01:00
committed by narimiran
parent babc9b234d
commit 564a88006a

View File

@@ -303,7 +303,7 @@ proc notFoundError*(c: PContext, n: PNode, errors: CandidateErrors) =
if n[0].kind in nkIdentKinds:
let ident = considerQuotedIdent(c, n[0], n).s
localError(c.config, n.info, errUndeclaredRoutine % ident)
else:
else:
localError(c.config, n.info, "expression '$1' cannot be called" % n[0].renderTree)
return
@@ -628,7 +628,7 @@ proc semOverloadedCall(c: PContext, n, nOrig: PNode,
if efExplain notin flags:
# repeat the overload resolution,
# this time enabling all the diagnostic output (this should fail again)
discard semOverloadedCall(c, n, nOrig, filter, flags + {efExplain})
result = semOverloadedCall(c, n, nOrig, filter, flags + {efExplain})
elif efNoUndeclared notin flags:
notFoundError(c, n, errors)