fix #13538 sigmatch errors are now sorted (#13701)

* fix #13538 sigmatch now sorted and has reliable order

* re-enable tests that were disabled because of that bug

* fix remaining tests and un-disable 2 other tests that were affected by this bug
This commit is contained in:
Timothee Cour 2020-03-20 01:28:03 -07:00 • committed by GitHub
commit dd362ab4c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 58 additions and 51 deletions

View file

@ -10,6 +10,8 @@
## This module implements semantic checking for calls.
# included from sem.nim
from algorithm import sort
proc sameMethodDispatcher(a, b: PSym): bool =
result = false
if a.kind == skMethod and b.kind == skMethod:
@ -178,9 +180,11 @@ proc presentFailedCandidates(c: PContext, n: PNode, errors: CandidateErrors):
var maybeWrongSpace = false
var candidatesAll: seq[string]
var candidates = ""
var skipped = 0
for err in errors:
candidates.setLen 0
if filterOnlyFirst and err.firstMismatch.arg == 1:
inc skipped
continue
@ -225,6 +229,9 @@ proc presentFailedCandidates(c: PContext, n: PNode, errors: CandidateErrors):
maybeWrongSpace = true
for diag in err.diagnostics:
candidates.add(diag & "\n")
candidatesAll.add candidates
candidatesAll.sort # fix #13538
candidates = join(candidatesAll)
if skipped > 0:
candidates.add($skipped & " other mismatching symbols have been " &
"suppressed; compile with --showAllMismatches:on to see them\n")