summary refs log tree commit diff stats
path: root/tests/effects
diff options
context:
space:
mode:
authorIDF <idf31@protonmail.com>2020-10-06 17:49:30 +0300
committerGitHub <noreply@github.com>2020-10-06 16:49:30 +0200
commit9560e49e8fa412839743aa86400bd73e2c57ab3d (patch)
tree0d342d9461fb30a2456c545266b50129463da92e /tests/effects
parent92163fa3304e5b6768a50d36a5243639ce4a2f69 (diff)
downloadNim-9560e49e8fa412839743aa86400bd73e2c57ab3d.tar.gz
New hint for unused exceptions in .raises (#15492)
* New hint for unused exceptions in .raises

* Fix effects test

* Further adapt teffects1.nim
Diffstat (limited to 'tests/effects')
-rw-r--r--tests/effects/teffects1.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/effects/teffects1.nim b/tests/effects/teffects1.nim
index 3551ff1a1..66d6a3518 100644
--- a/tests/effects/teffects1.nim
+++ b/tests/effects/teffects1.nim
@@ -1,5 +1,10 @@
 discard """
   cmd: "nim check $file"
+  nimout: '''teffects1.nim(22, 28) template/generic instantiation from here
+teffects1.nim(23, 13) Error: can raise an unlisted exception: ref IOError
+teffects1.nim(22, 29) Hint: 'lier' cannot raise 'IO2Error' [XCannotRaiseY]
+teffects1.nim(38, 21) Error: type mismatch: got <proc (x: int): string{.noSideEffect, gcsafe, locks: 0.}> but expected 'MyProcType = proc (x: int): string{.closure.}'
+.raise effects differ'''
 """
 
 type
@@ -12,7 +17,7 @@ type
 proc forw: int {. .}
 
 proc lier(): int {.raises: [IO2Error].} =
-  #[tt.Hint                 ^ 'IO2Error' is declared but not used [XDeclaredButNotUsed] ]#
+  #[tt.Hint                 ^ 'lier' cannot raise 'IO2Error' [XCannotRaiseY] ]#
   writeLine stdout, "arg" #[tt.Error
             ^  can raise an unlisted exception: ref IOError
   ]#