summary refs log tree commit diff stats
path: root/tests/generics/t13525.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/generics/t13525.nim')
-rw-r--r--tests/generics/t13525.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/generics/t13525.nim b/tests/generics/t13525.nim
new file mode 100644
index 000000000..1fd84852b
--- /dev/null
+++ b/tests/generics/t13525.nim
@@ -0,0 +1,6 @@
+# https://github.com/nim-lang/Nim/issues/13524
+template fun(field): untyped = astToStr(field)
+proc test1(): string = fun(nonexistent1)
+proc test2[T](): string = fun(nonexistent2) # used to cause: Error: undeclared identifier: 'nonexistent2'
+doAssert test1() == "nonexistent1"
+doAssert test2[int]() == "nonexistent2"