summary refs log tree commit diff stats
path: root/tests/errmsgs/undeclared_routime_compiles.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errmsgs/undeclared_routime_compiles.nim')
-rw-r--r--tests/errmsgs/undeclared_routime_compiles.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/errmsgs/undeclared_routime_compiles.nim b/tests/errmsgs/undeclared_routime_compiles.nim
new file mode 100644
index 000000000..21daf82bf
--- /dev/null
+++ b/tests/errmsgs/undeclared_routime_compiles.nim
@@ -0,0 +1,11 @@
+# D20180828T234921:here
+template foo*(iter: untyped): untyped =
+  when compiles(iter.unexistingField): 0
+  elif compiles(iter.len): 1
+  else: 2
+
+proc foo[A]()=
+  let a2 = @[10, 11]
+  let a3 = foo(pairs(a2))
+
+foo[int]()