New hint for unused exceptions in .raises (#15492)
* New hint for unused exceptions in .raises * Fix effects test * Further adapt teffects1.nim
This commit is contained in:
parent
92163fa330
commit
9560e49e8f
3 changed files with 14 additions and 5 deletions
|
|
@ -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
|
||||
]#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue