diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2022-10-11 15:17:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-11 09:17:09 +0200 |
commit | 5602183234f59ece4fd668915da848f0753cbbb9 (patch) | |
tree | b955da8037206560cdc9628d94a3b604bd9ac631 /tests/errmsgs | |
parent | 75873715546142a6f6f78180abdf1c1ddc0416e5 (diff) | |
download | Nim-5602183234f59ece4fd668915da848f0753cbbb9.tar.gz |
'lock levels' are deprecated, now a noop (#20539)
* 'lock levels' are deprecated, now a noop * fixes tests
Diffstat (limited to 'tests/errmsgs')
-rw-r--r-- | tests/errmsgs/t10489_a.nim | 2 | ||||
-rw-r--r-- | tests/errmsgs/t10489_b.nim | 2 | ||||
-rw-r--r-- | tests/errmsgs/t18886.nim | 4 | ||||
-rw-r--r-- | tests/errmsgs/t2614.nim | 4 | ||||
-rw-r--r-- | tests/errmsgs/t5167_4.nim | 2 | ||||
-rw-r--r-- | tests/errmsgs/tgcsafety.nim | 6 | ||||
-rw-r--r-- | tests/errmsgs/tproc_mismatch.nim | 25 | ||||
-rw-r--r-- | tests/errmsgs/tsigmatch.nim | 28 | ||||
-rw-r--r-- | tests/errmsgs/ttypeAllowed.nim | 8 |
9 files changed, 39 insertions, 42 deletions
diff --git a/tests/errmsgs/t10489_a.nim b/tests/errmsgs/t10489_a.nim index 71a6cc3c4..c762ce876 100644 --- a/tests/errmsgs/t10489_a.nim +++ b/tests/errmsgs/t10489_a.nim @@ -1,5 +1,5 @@ discard """ -errormsg: "invalid type: 'macro (body: untyped): untyped{.noSideEffect, gcsafe, locks: 0.}' for let. Did you mean to call the macro with '()'?" +errormsg: "invalid type: 'macro (body: untyped): untyped{.noSideEffect, gcsafe.}' for let. Did you mean to call the macro with '()'?" line: 9 """ diff --git a/tests/errmsgs/t10489_b.nim b/tests/errmsgs/t10489_b.nim index 4b0b876e5..df05f0e6e 100644 --- a/tests/errmsgs/t10489_b.nim +++ b/tests/errmsgs/t10489_b.nim @@ -1,5 +1,5 @@ discard """ -errormsg: "invalid type: 'macro (body: untyped): untyped{.noSideEffect, gcsafe, locks: 0.}' for const. Did you mean to call the macro with '()'?" +errormsg: "invalid type: 'macro (body: untyped): untyped{.noSideEffect, gcsafe.}' for const. Did you mean to call the macro with '()'?" line: 9 """ diff --git a/tests/errmsgs/t18886.nim b/tests/errmsgs/t18886.nim index cad62d431..8ed160c64 100644 --- a/tests/errmsgs/t18886.nim +++ b/tests/errmsgs/t18886.nim @@ -3,8 +3,8 @@ discard """ errormsg: "" nimout: ''' t18886.nim(18, 24) Error: ambiguous identifier: 'bar' -- you need a helper proc to disambiguate the following: - t18886.bar: proc (i: ptr int){.noSideEffect, gcsafe, locks: 0.} - t18886.bar: proc (i: ptr char){.noSideEffect, gcsafe, locks: 0.} + t18886.bar: proc (i: ptr int){.noSideEffect, gcsafe.} + t18886.bar: proc (i: ptr char){.noSideEffect, gcsafe.} ''' """ diff --git a/tests/errmsgs/t2614.nim b/tests/errmsgs/t2614.nim index 4034249e7..031ecb9d1 100644 --- a/tests/errmsgs/t2614.nim +++ b/tests/errmsgs/t2614.nim @@ -2,9 +2,9 @@ discard """ cmd: "nim check $options --hints:off $file" errormsg: "" nimout: ''' -t2614.nim(19, 27) Error: type mismatch: got <array[0..1, proc (){.locks: <unknown>.}]> but expected 'array[0..1, proc (){.closure.}]' +t2614.nim(19, 27) Error: type mismatch: got <array[0..1, proc ()]> but expected 'array[0..1, proc (){.closure.}]' Calling convention mismatch: got '{.nimcall.}', but expected '{.closure.}'. -t2614.nim(21, 22) Error: type mismatch: got <seq[proc (){.locks: <unknown>.}]> but expected 'seq[proc (){.closure.}]' +t2614.nim(21, 22) Error: type mismatch: got <seq[proc ()]> but expected 'seq[proc (){.closure.}]' Calling convention mismatch: got '{.nimcall.}', but expected '{.closure.}'. ''' """ diff --git a/tests/errmsgs/t5167_4.nim b/tests/errmsgs/t5167_4.nim index 7a263622b..dafd7754d 100644 --- a/tests/errmsgs/t5167_4.nim +++ b/tests/errmsgs/t5167_4.nim @@ -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.}>" line: 19 """ diff --git a/tests/errmsgs/tgcsafety.nim b/tests/errmsgs/tgcsafety.nim index 701adeebf..66496d364 100644 --- a/tests/errmsgs/tgcsafety.nim +++ b/tests/errmsgs/tgcsafety.nim @@ -1,8 +1,8 @@ discard """ cmd: "nim check $file" -errormsg: "type mismatch: got <AsyncHttpServer, Port, proc (req: Request): Future[system.void]{.locks: <unknown>.}>" +errormsg: "type mismatch: got <AsyncHttpServer, Port, proc (req: Request): Future[system.void]>" nimout: ''' -tgcsafety.nim(31, 18) Error: type mismatch: got <AsyncHttpServer, Port, proc (req: Request): Future[system.void]{.locks: <unknown>.}> +tgcsafety.nim(31, 18) Error: type mismatch: got <AsyncHttpServer, Port, proc (req: Request): Future[system.void]> but expected one of: proc serve(server: AsyncHttpServer; port: Port; callback: proc (request: Request): Future[void] {.closure, gcsafe.}; @@ -10,7 +10,7 @@ proc serve(server: AsyncHttpServer; port: Port; Future[void]) first type mismatch at position: 3 required type for callback: proc (request: Request): Future[system.void]{.closure, gcsafe.} - but expression 'cb' is of type: proc (req: Request): Future[system.void]{.locks: <unknown>.} + but expression 'cb' is of type: proc (req: Request): Future[system.void] This expression is not GC-safe. Annotate the proc with {.gcsafe.} to get extended error information. expression: serve(server, Port(7898), cb) diff --git a/tests/errmsgs/tproc_mismatch.nim b/tests/errmsgs/tproc_mismatch.nim index f92589d96..16f319f3b 100644 --- a/tests/errmsgs/tproc_mismatch.nim +++ b/tests/errmsgs/tproc_mismatch.nim @@ -3,36 +3,36 @@ discard """ cmd: '''nim check --hints:off $options $file''' nimoutFull: true nimout: ''' -tproc_mismatch.nim(38, 52) Error: type mismatch: got <proc (a: int, c: float){.cdecl, noSideEffect, gcsafe, locks: 0.}> but expected 'proc (a: int, c: float){.closure, noSideEffect.}' +tproc_mismatch.nim(38, 52) Error: type mismatch: got <proc (a: int, c: float){.cdecl, noSideEffect, gcsafe.}> but expected 'proc (a: int, c: float){.closure, noSideEffect.}' Calling convention mismatch: got '{.cdecl.}', but expected '{.closure.}'. -tproc_mismatch.nim(42, 6) Error: type mismatch: got <proc (){.inline, noSideEffect, gcsafe, locks: 0.}> +tproc_mismatch.nim(42, 6) Error: type mismatch: got <proc (){.inline, noSideEffect, gcsafe.}> but expected one of: proc bar(a: proc ()) first type mismatch at position: 1 required type for a: proc (){.closure.} - but expression 'fn1' is of type: proc (){.inline, noSideEffect, gcsafe, locks: 0.} + but expression 'fn1' is of type: proc (){.inline, noSideEffect, gcsafe.} Calling convention mismatch: got '{.inline.}', but expected '{.closure.}'. expression: bar(fn1) -tproc_mismatch.nim(46, 8) Error: type mismatch: got <proc (){.inline, noSideEffect, gcsafe, locks: 0.}> but expected 'proc (){.closure.}' +tproc_mismatch.nim(46, 8) Error: type mismatch: got <proc (){.inline, noSideEffect, gcsafe.}> but expected 'proc (){.closure.}' Calling convention mismatch: got '{.inline.}', but expected '{.closure.}'. -tproc_mismatch.nim(51, 8) Error: type mismatch: got <proc (){.locks: 0.}> but expected 'proc (){.closure, noSideEffect.}' +tproc_mismatch.nim(51, 8) Error: type mismatch: got <proc ()> but expected 'proc (){.closure, noSideEffect.}' Calling convention mismatch: got '{.nimcall.}', but expected '{.closure.}'. Pragma mismatch: got '{..}', but expected '{.noSideEffect.}'. -tproc_mismatch.nim(55, 8) Error: type mismatch: got <proc (a: int){.noSideEffect, gcsafe, locks: 0.}> but expected 'proc (a: float){.closure.}' +tproc_mismatch.nim(55, 8) Error: type mismatch: got <proc (a: int){.noSideEffect, gcsafe.}> but expected 'proc (a: float){.closure.}' Calling convention mismatch: got '{.nimcall.}', but expected '{.closure.}'. -tproc_mismatch.nim(64, 9) Error: type mismatch: got <proc (a: int){.locks: 0.}> but expected 'proc (a: int){.closure, gcsafe.}' +tproc_mismatch.nim(64, 9) Error: type mismatch: got <proc (a: int)> but expected 'proc (a: int){.closure, gcsafe.}' Calling convention mismatch: got '{.nimcall.}', but expected '{.closure.}'. Pragma mismatch: got '{..}', but expected '{.gcsafe.}'. tproc_mismatch.nim(72, 9) Error: type mismatch: got <proc (a: int): int{.nimcall.}> but expected 'proc (a: int): int{.cdecl.}' Calling convention mismatch: got '{.nimcall.}', but expected '{.cdecl.}'. tproc_mismatch.nim(73, 9) Error: type mismatch: got <proc (a: int): int{.cdecl.}> but expected 'proc (a: int): int{.nimcall.}' Calling convention mismatch: got '{.cdecl.}', but expected '{.nimcall.}'. -tproc_mismatch.nim(77, 9) Error: type mismatch: got <proc (a: int){.closure, locks: 3.}> but expected 'proc (a: int){.closure, locks: 1.}' - Pragma mismatch: got '{.locks: 3.}', but expected '{.locks: 1.}'. -lock levels differ ''' """ + + + block: # CallConv mismatch func a(a: int, c: float) {.cdecl.} = discard var b: proc(a: int, c: float) {.noSideEffect.} = a @@ -71,7 +71,4 @@ block: # Indrection through pragmas var fn2: proc(a: int): int {.inl2, p2.} fn2 = fn1 fn1 = fn2 -block: # Lock levels differ - var fn1: proc(a: int){.locks: 3.} - var fn2: proc(a: int){.locks: 1.} - fn2 = fn1 + diff --git a/tests/errmsgs/tsigmatch.nim b/tests/errmsgs/tsigmatch.nim index 49b355982..85ed34169 100644 --- a/tests/errmsgs/tsigmatch.nim +++ b/tests/errmsgs/tsigmatch.nim @@ -12,34 +12,34 @@ proc f(b: B) but expression 'A()' is of type: A expression: f(A(), "extra") -tsigmatch.nim(125, 6) Error: type mismatch: got <(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: (string, proc (){.closure.}) - but expression '("foobar", proc () = echo(["Hello!"]))' is of type: (string, proc (){.gcsafe, locks: 0.}) + 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) @@ -135,12 +135,12 @@ block: # 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 diff --git a/tests/errmsgs/ttypeAllowed.nim b/tests/errmsgs/ttypeAllowed.nim index 516b616e0..fdb4c70b8 100644 --- a/tests/errmsgs/ttypeAllowed.nim +++ b/tests/errmsgs/ttypeAllowed.nim @@ -2,10 +2,10 @@ discard """ cmd: "nim check $file" errormsg: "" nimout: ''' -ttypeAllowed.nim(13, 5) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe, locks: 0.}' for let -ttypeAllowed.nim(17, 7) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe, locks: 0.}' for const -ttypeAllowed.nim(21, 5) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe, locks: 0.}' for var -ttypeAllowed.nim(26, 10) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe, locks: 0.}' for result +ttypeAllowed.nim(13, 5) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe.}' for let +ttypeAllowed.nim(17, 7) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe.}' for const +ttypeAllowed.nim(21, 5) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe.}' for var +ttypeAllowed.nim(26, 10) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe.}' for result ''' """ |