summary refs log tree commit diff stats
path: root/tests/system/tinvalidnot.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/system/tinvalidnot.nim')
-rw-r--r--tests/system/tinvalidnot.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/system/tinvalidnot.nim b/tests/system/tinvalidnot.nim
new file mode 100644
index 000000000..df0291a8a
--- /dev/null
+++ b/tests/system/tinvalidnot.nim
@@ -0,0 +1,19 @@
+discard """
+  errormsg: "type mismatch"
+  file: "tinvalidnot.nim"
+  line: 14
+"""
+# BUG: following compiles, but should not:
+
+proc nodeOfDegree(x: int): bool =
+  result = false
+
+proc main =
+  for j in 0..2:
+    for i in 0..10:
+      if not nodeOfDegree(1) >= 0: #ERROR_MSG type mismatch
+        echo "Yes"
+      else:
+        echo "No"
+
+main()