diff options
Diffstat (limited to 'tests/errmsgs/tsigmatch.nim')
-rw-r--r-- | tests/errmsgs/tsigmatch.nim | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/tests/errmsgs/tsigmatch.nim b/tests/errmsgs/tsigmatch.nim index 21e2c217d..85ed34169 100644 --- a/tests/errmsgs/tsigmatch.nim +++ b/tests/errmsgs/tsigmatch.nim @@ -1,45 +1,45 @@ discard """ - cmd: "nim check --showAllMismatches:on --hints:off $file" + cmd: "nim check --mm:refc --showAllMismatches:on --hints:off $file" nimout: ''' tsigmatch.nim(111, 4) Error: type mismatch: got <A, string> but expected one of: +proc f(a: A) + first type mismatch at position: 2 + extra argument given proc f(b: B) first type mismatch at position: 1 required type for b: B but expression 'A()' is of type: A -proc f(a: A) - first type mismatch at position: 2 - extra argument given expression: f(A(), "extra") -tsigmatch.nim(125, 6) Error: type mismatch: got <tuple of (string, proc (){.gcsafe, locks: 0.})> +tsigmatch.nim(125, 6) Error: type mismatch: got <(string, proc (){.gcsafe.})> but expected one of: proc foo(x: (string, proc ())) first type mismatch at position: 1 - required type for x: tuple of (string, proc (){.closure.}) - but expression '("foobar", proc () = echo(["Hello!"]))' is of type: tuple of (string, proc (){.gcsafe, locks: 0.}) + required type for x: (string, proc (){.closure.}) + but expression '("foobar", proc () = echo(["Hello!"]))' is of type: (string, proc (){.gcsafe.}) expression: foo(("foobar", proc () = echo(["Hello!"]))) -tsigmatch.nim(132, 11) Error: type mismatch: got <proc (s: string): string{.noSideEffect, gcsafe, locks: 0.}> +tsigmatch.nim(132, 11) Error: type mismatch: got <proc (s: string): string{.noSideEffect, gcsafe.}> but expected one of: proc foo[T, S](op: proc (x: T): S {.cdecl.}): auto first type mismatch at position: 1 required type for op: proc (x: T): S{.cdecl.} - but expression 'fun' is of type: proc (s: string): string{.noSideEffect, gcsafe, locks: 0.} + but expression 'fun' is of type: proc (s: string): string{.noSideEffect, gcsafe.} proc foo[T, S](op: proc (x: T): S {.safecall.}): auto first type mismatch at position: 1 required type for op: proc (x: T): S{.safecall.} - but expression 'fun' is of type: proc (s: string): string{.noSideEffect, gcsafe, locks: 0.} + but expression 'fun' is of type: proc (s: string): string{.noSideEffect, gcsafe.} expression: foo(fun) -tsigmatch.nim(143, 13) Error: type mismatch: got <array[0..0, proc (x: int){.gcsafe, locks: 0.}]> +tsigmatch.nim(143, 13) Error: type mismatch: got <array[0..0, proc (x: int){.gcsafe.}]> but expected one of: -proc takesFuncs(fs: openArray[proc (x: int) {.gcsafe, locks: 0.}]) +proc takesFuncs(fs: openArray[proc (x: int) {.gcsafe.}]) first type mismatch at position: 1 - required type for fs: openArray[proc (x: int){.closure, gcsafe, locks: 0.}] - but expression '[proc (x: int) {.gcsafe, locks: 0.} = echo [x]]' is of type: array[0..0, proc (x: int){.gcsafe, locks: 0.}] + required type for fs: openArray[proc (x: int){.closure, gcsafe.}] + but expression '[proc (x: int) {.gcsafe.} = echo [x]]' is of type: array[0..0, proc (x: int){.gcsafe.}] -expression: takesFuncs([proc (x: int) {.gcsafe, locks: 0.} = echo [x]]) +expression: takesFuncs([proc (x: int) {.gcsafe.} = echo [x]]) tsigmatch.nim(149, 4) Error: type mismatch: got <int literal(10), a0: int literal(5), string> but expected one of: proc f(a0: uint8; b: string) @@ -61,14 +61,14 @@ proc f(a1: string; a2: varargs[string]; a3: float; a4: var string) expression: f("asdf", "1", "2", "3", "4", 2.3, "bad") tsigmatch.nim(164, 4) Error: type mismatch: got <string, a0: int literal(12)> but expected one of: -proc f(x: string; a0: var int) - first type mismatch at position: 2 - required type for a0: var int - but expression 'a0 = 12' is immutable, not 'var' proc f(x: string; a0: string) first type mismatch at position: 2 required type for a0: string but expression 'a0 = 12' is of type: int literal(12) +proc f(x: string; a0: var int) + first type mismatch at position: 2 + required type for a0: var int + but expression 'a0 = 12' is immutable, not 'var' expression: f(foo, a0 = 12) tsigmatch.nim(171, 7) Error: type mismatch: got <Mystring, string> @@ -89,22 +89,22 @@ expression: fun1(default(Mystring), "asdf") - - - +#[ +see also: tests/errmsgs/tdeclaredlocs.nim +]# ## line 100 -block: +when true: # bug #11061 Type mismatch error "first type mismatch at" points to wrong argument/position # Note: the error msg now gives correct position for mismatched argument type A = object of RootObj B = object of A - +block: proc f(b: B) = discard proc f(a: A) = discard @@ -132,15 +132,15 @@ block: echo foo(fun) block: - # bug #10285 Function signature don't match when inside seq/array/openarray + # bug #10285 Function signature don't match when inside seq/array/openArray # Note: the error message now shows `closure` which helps debugging the issue # out why it doesn't match - proc takesFunc(f: proc (x: int) {.gcsafe, locks: 0.}) = + proc takesFunc(f: proc (x: int) {.gcsafe.}) = echo "takes single Func" - proc takesFuncs(fs: openarray[proc (x: int) {.gcsafe, locks: 0.}]) = + proc takesFuncs(fs: openArray[proc (x: int) {.gcsafe.}]) = echo "takes multiple Func" - takesFunc(proc (x: int) {.gcsafe, locks: 0.} = echo x) # works - takesFuncs([proc (x: int) {.gcsafe, locks: 0.} = echo x]) # fails + takesFunc(proc (x: int) {.gcsafe.} = echo x) # works + takesFuncs([proc (x: int) {.gcsafe.} = echo x]) # fails block: # bug https://github.com/nim-lang/Nim/issues/11061#issuecomment-508970465 @@ -163,7 +163,7 @@ block: var foo = "" f(foo, a0 = 12) -block: +when true: type Mystring = string type MyInt = int proc fun1(a1: MyInt, a2: Mystring) = discard |