better error messages: use <T1, T2> instead of (T1, T2) in order to prevent confusions with tuple types
This commit is contained in:
parent
51d81c4e23
commit
ef6eda4cb4
25 changed files with 62 additions and 62 deletions
|
|
@ -1,5 +1,5 @@
|
|||
discard """
|
||||
errormsg: "type mismatch: got (string, arr: seq[empty])"
|
||||
errormsg: "type mismatch: got <string, arr: seq[empty]>"
|
||||
line: 15
|
||||
"""
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
"""
|
||||
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
'''
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
'''
|
||||
"""
|
||||
|
||||
|
|
|
|||
|
|
@ -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)'''
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue