summary refs log tree commit diff stats
path: root/tests/misc/t20289.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/t20289.nim')
-rw-r--r--tests/misc/t20289.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/misc/t20289.nim b/tests/misc/t20289.nim
new file mode 100644
index 000000000..5a0a269f0
--- /dev/null
+++ b/tests/misc/t20289.nim
@@ -0,0 +1,15 @@
+discard """
+  action: reject
+"""
+
+type E[T] = object
+  v: T
+
+template j[T](R: type E[T], x: untyped): R = R(v: x)
+template d[T](O: type E, v: T): E[T] = E[T].j(v)
+
+proc w[T](): E[T] =
+  template r(k: int): auto = default(T)
+  E.d r
+
+discard w[int]()