summary refs log tree commit diff stats
path: root/tests/effects
diff options
context:
space:
mode:
authorBung <crc32@qq.com>2022-09-26 17:58:13 +0800
committerGitHub <noreply@github.com>2022-09-26 11:58:13 +0200
commite13cd40e21dbfa7d9981e2eeb2aa09625d3deda5 (patch)
treed051092403d414ba7f19c0202e9df50c404fa78e /tests/effects
parentf7f375f59d99ab0006d3aab839449e61cc8153c0 (diff)
downloadNim-e13cd40e21dbfa7d9981e2eeb2aa09625d3deda5.tar.gz
fix #2614 improve error message when array of proc calling convention… (#20379)
fix #2614 improve error message when array of proc calling convention mismatch
Diffstat (limited to 'tests/effects')
-rw-r--r--tests/effects/teffects1.nim7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/effects/teffects1.nim b/tests/effects/teffects1.nim
index 3978d8cc2..ca9021999 100644
--- a/tests/effects/teffects1.nim
+++ b/tests/effects/teffects1.nim
@@ -1,5 +1,5 @@
 discard """
-  cmd: "nim check $file"
+  cmd: "nim check --hint:Conf:off --hint:XDeclaredButNotUsed:off $file"
   nimout: '''
 teffects1.nim(17, 28) template/generic instantiation from here
 '''
@@ -27,14 +27,15 @@ proc forw: int =
 type
   MyProcType* = proc(x: int): string #{.raises: [ValueError, Defect].}
 
-proc foo(x: int): string {.raises: [ValueError].} =
+proc foo(x: int): string {.nimcall, raises: [ValueError].} =
   if x > 9:
     raise newException(ValueError, "Use single digit")
   $x
 
 var p: MyProcType = foo #[tt.Error
                     ^
-type mismatch: got <proc (x: int): string{.noSideEffect, gcsafe, locks: 0.}> but expected 'MyProcType = proc (x: int): string{.closure.}'
+type mismatch: got <proc (x: int): string{.nimcall, noSideEffect, gcsafe, locks: 0.}> but expected 'MyProcType = proc (x: int): string{.closure.}'
+  Calling convention mismatch: got '{.nimcall.}', but expected '{.closure.}'.
 .raise effects differ
 ]#
 {.pop.}