show all mismatching overloads again

This commit is contained in:
Araq 2018-08-27 17:07:05 +02:00
commit 7bb93c730e

View file

@ -166,18 +166,20 @@ proc presentFailedCandidates(c: PContext, n: PNode, errors: CandidateErrors):
prefer = preferModuleInfo prefer = preferModuleInfo
break break
# we pretend procs are attached to the type of the first when false:
# argument in order to remove plenty of candidates. This is # we pretend procs are attached to the type of the first
# comparable to what C# does and C# is doing fine. # argument in order to remove plenty of candidates. This is
var filterOnlyFirst = false # comparable to what C# does and C# is doing fine.
for err in errors: var filterOnlyFirst = false
if err.firstMismatch > 1: for err in errors:
filterOnlyFirst = true if err.firstMismatch > 1:
break filterOnlyFirst = true
break
var candidates = "" var candidates = ""
for err in errors: for err in errors:
if filterOnlyFirst and err.firstMismatch == 1: continue when false:
if filterOnlyFirst and err.firstMismatch == 1: continue
if err.sym.kind in routineKinds and err.sym.ast != nil: if err.sym.kind in routineKinds and err.sym.ast != nil:
add(candidates, renderTree(err.sym.ast, add(candidates, renderTree(err.sym.ast,
{renderNoBody, renderNoComments, renderNoPragmas})) {renderNoBody, renderNoComments, renderNoPragmas}))