better error messages: use <T1, T2> instead of (T1, T2) in order to prevent confusions with tuple types

This commit is contained in:
Araq 2018-02-10 20:39:05 +01:00
commit ef6eda4cb4
25 changed files with 62 additions and 62 deletions

View file

@ -1,5 +1,5 @@
discard """
errormsg: "type mismatch: got (string, arr: seq[empty])"
errormsg: "type mismatch: got <string, arr: seq[empty]>"
line: 15
"""

View file

@ -1,5 +1,5 @@
discard """
errormsg: "type mismatch: got (proc [*missing parameters*](x: int) | proc (x: string){.gcsafe, locks: 0.})"
errormsg: "type mismatch: got <proc [*missing parameters*](x: int) | proc (x: string){.gcsafe, locks: 0.}>"
line: 19
"""

View file

@ -2,15 +2,15 @@ discard """
errormsg: "cannot instantiate B"
line: 20
nimout: '''
got: (type string)
but expected: (T: A)
got: <type string>
but expected: <T: A>
'''
"""
type
A = concept c
advance(c)
B[T: A] = object
child: ref B[T]

View file

@ -1,13 +1,13 @@
discard """
cmd: "nim check $file"
errormsg: "type mismatch: got (int literal(1), int literal(2), int literal(3))"
errormsg: "type mismatch: got <int literal(1), int literal(2), int literal(3)>"
nimout: '''
but expected one of:
proc main(a, b, c: string)
first type mismatch at position: 1
required type: string
but expression '1' is of type: int literal(1)
first type mismatch at position: 1
required type: string
but expression '1' is of type: int literal(1)
expression: main(1, 2, 3)
'''

View file

@ -2,8 +2,8 @@ discard """
errormsg: "cannot instantiate B"
line: 14
nimout: '''
got: (type int)
but expected: (T: string or float)
got: <type int>
but expected: <T: string or float>
'''
"""

View file

@ -1,7 +1,7 @@
discard """
errormsg: '''got (tuple of (type NimEdAppWindow, int))'''
errormsg: '''got <tuple of (type NimEdAppWindow, int)>'''
line: 22
nimout: '''got (tuple of (type NimEdAppWindow, int))
nimout: '''got <tuple of (type NimEdAppWindow, int)>
but expected one of:
template xxx(tn: typedesc; i: int)'''
"""

View file

@ -1,5 +1,5 @@
discard """
errormsg: "type mismatch: got (int) but expected 'cshort = int16'"
errormsg: "type mismatch: got <int> but expected 'cshort = int16'"
line: 12
column: 10
file: "tshow_asgn.nim"