summary refs log tree commit diff stats
path: root/tests/notnil
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2020-04-23 19:52:33 +0200
committerGitHub <noreply@github.com>2020-04-23 19:52:33 +0200
commiteca8f1d79f712613437918e397f7abb58bc29515 (patch)
tree1f824ca8b78020bed8b76a13d41a3482b14206c0 /tests/notnil
parent66db9de714be7c2f4cf1f2fb0a0a99145baf6acb (diff)
downloadNim-eca8f1d79f712613437918e397f7abb58bc29515.tar.gz
Add tests for #8481, #6490 and #4061 (#14083)
Diffstat (limited to 'tests/notnil')
-rw-r--r--tests/notnil/tmust_compile.nim10
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)