diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2022-08-12 09:03:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-12 09:03:10 +0800 |
commit | 1a7b33942b69a60178134c5e1c6f76d0875694d2 (patch) | |
tree | 481b868d8d17ac5150635a8e9444911b05cfa60c /tests/effects | |
parent | ff25103c9ab9d51821e9e8641955c8d24f7db6b8 (diff) | |
download | Nim-1a7b33942b69a60178134c5e1c6f76d0875694d2.tar.gz |
closes #6559; add testcase (#20200)
Diffstat (limited to 'tests/effects')
-rw-r--r-- | tests/effects/tstrict_effects3.nim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/effects/tstrict_effects3.nim b/tests/effects/tstrict_effects3.nim index 4cc461549..027b46474 100644 --- a/tests/effects/tstrict_effects3.nim +++ b/tests/effects/tstrict_effects3.nim @@ -27,3 +27,20 @@ func mkEnter() = helper() else: let ast = getAst(helper()) + + +# bug #6559 +type + SafeFn = proc (): void {. raises: [] } + +proc ok() {. raises: [] .} = discard +proc fail() {. raises: [] .} + +let f1 : SafeFn = ok +let f2 : SafeFn = fail + + +proc fail() = discard +f1() +f2() + |