summary refs log tree commit diff stats
path: root/tests/reject/tinvwhen.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/reject/tinvwhen.nim')
-rw-r--r--tests/reject/tinvwhen.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/reject/tinvwhen.nim b/tests/reject/tinvwhen.nim
new file mode 100644
index 000000000..8dc8cbf50
--- /dev/null
+++ b/tests/reject/tinvwhen.nim
@@ -0,0 +1,8 @@
+# This was parsed even though it should not!

+

+proc chdir(path: CString): cint {.importc: "chdir", header: "dirHeader".}

+

+proc getcwd(buf: CString, buflen: cint): CString

+    when defined(unix): {.importc: "getcwd", header: "<unistd.h>".} #ERROR_MSG invalid indentation

+    elif defined(windows): {.importc: "getcwd", header: "<direct.h>"}

+    else: {.error: "os library not ported to your OS. Please help!".}