diff options
author | Clyybber <darkmine956@gmail.com> | 2020-04-23 19:52:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-23 19:52:33 +0200 |
commit | eca8f1d79f712613437918e397f7abb58bc29515 (patch) | |
tree | 1f824ca8b78020bed8b76a13d41a3482b14206c0 /tests/notnil | |
parent | 66db9de714be7c2f4cf1f2fb0a0a99145baf6acb (diff) | |
download | Nim-eca8f1d79f712613437918e397f7abb58bc29515.tar.gz |
Add tests for #8481, #6490 and #4061 (#14083)
Diffstat (limited to 'tests/notnil')
-rw-r--r-- | tests/notnil/tmust_compile.nim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/notnil/tmust_compile.nim b/tests/notnil/tmust_compile.nim index d09dda057..3a013e9ed 100644 --- a/tests/notnil/tmust_compile.nim +++ b/tests/notnil/tmust_compile.nim @@ -63,3 +63,13 @@ proc parse(cts: CTS, jn: JsonNode) = proc p(x: proc(){.closure.} not nil) = discard p(proc(){.closure.} = discard) + +# bug #6490 + +proc p2(a: proc()) = + if a.isNil: + raise newException(ValueError, "a is nil") + else: + let b: proc() not nil = a + +p2(writeStackTrace) |