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

@ -1,6 +1,5 @@
discard """
errormsg: "type mismatch: got <Bar[system.int]>"
disabled: "32bit"
nimout: '''
t3330.nim(78, 4) Error: type mismatch: got <Bar[system.int]>
but expected one of:
@ -9,33 +8,33 @@ proc test(foo: Foo[int])
required type for foo: Foo[int]
but expression 'bar' is of type: Bar[system.int]
t3330.nim(63, 8) Hint: Non-matching candidates for add(k, string, T)
proc add(x: var string; y: string)
first type mismatch at position: 1
required type for x: var string
but expression 'k' is of type: Alias
proc add[T](x: var seq[T]; y: openArray[T])
first type mismatch at position: 1
required type for x: var seq[T]
but expression 'k' is of type: Alias
proc add(result: var string; x: float)
first type mismatch at position: 1
required type for result: var string
but expression 'k' is of type: Alias
proc add[T](x: var seq[T]; y: T)
proc add(result: var string; x: int64)
first type mismatch at position: 1
required type for x: var seq[T]
but expression 'k' is of type: Alias
proc add(x: var string; y: cstring)
first type mismatch at position: 1
required type for x: var string
required type for result: var string
but expression 'k' is of type: Alias
proc add(x: var string; y: char)
first type mismatch at position: 1
required type for x: var string
but expression 'k' is of type: Alias
proc add(result: var string; x: int64)
proc add(x: var string; y: cstring)
first type mismatch at position: 1
required type for result: var string
required type for x: var string
but expression 'k' is of type: Alias
proc add(x: var string; y: string)
first type mismatch at position: 1
required type for x: var string
but expression 'k' is of type: Alias
proc add[T](x: var seq[T]; y: T)
first type mismatch at position: 1
required type for x: var seq[T]
but expression 'k' is of type: Alias
proc add[T](x: var seq[T]; y: openArray[T])
first type mismatch at position: 1
required type for x: var seq[T]
but expression 'k' is of type: Alias
t3330.nim(63, 8) template/generic instantiation of `add` from here
@ -46,10 +45,11 @@ t3330.nim(71, 6) Foo: 'bar.x' cannot be assigned to
expression: test(bar)'''
"""
# Note: currently disabled on 32bit because the candidates are presented in
# different order on travis with `NIM_COMPILE_TO_CPP=false CPU=i386`;
# a possible fix would be to sort the candidates by proc signature or
# declaration location