parent
518b794491
commit
4b09a89758
3 changed files with 47 additions and 3 deletions
|
|
@ -82,7 +82,7 @@ proc notFoundError*(c: PContext, n: PNode, errors: seq[string]) =
|
|||
# fail fast:
|
||||
globalError(n.info, errTypeMismatch, "")
|
||||
var result = msgKindToString(errTypeMismatch)
|
||||
add(result, describeArgs(c, n, 1 + ord(nfDotField in n.flags)))
|
||||
add(result, describeArgs(c, n, 1))
|
||||
add(result, ')')
|
||||
|
||||
var candidates = ""
|
||||
|
|
@ -114,7 +114,7 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
|
|||
|
||||
var errors: seq[string]
|
||||
var usedSyms: seq[PNode]
|
||||
|
||||
|
||||
template pickBest(headSymbol: expr) =
|
||||
pickBestCandidate(c, headSymbol, n, orig, initialBinding,
|
||||
filter, result, alt, errors)
|
||||
|
|
@ -166,7 +166,7 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
|
|||
n.sons[0..1] = [callOp, n[1], calleeName]
|
||||
orig.sons[0..1] = [callOp, orig[1], calleeName]
|
||||
pickBest(callOp)
|
||||
|
||||
|
||||
if overloadsState == csEmpty and result.state == csEmpty:
|
||||
localError(n.info, errUndeclaredIdentifier, considerAcc(f).s)
|
||||
return
|
||||
|
|
@ -175,9 +175,15 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
|
|||
localError(n.info, errExprXCannotBeCalled,
|
||||
renderTree(n, {renderNoComments}))
|
||||
else:
|
||||
if {nfDotField, nfDotSetter} * n.flags != {}:
|
||||
# clean up the inserted ops
|
||||
n.sons.delete(2)
|
||||
n.sons[0] = f
|
||||
|
||||
errors = @[]
|
||||
pickBest(f)
|
||||
notFoundError(c, n, errors)
|
||||
|
||||
return
|
||||
|
||||
if alt.state == csMatch and cmpCandidates(result, alt) == 0 and
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue