summary refs log tree commit diff stats
path: root/tests/misc/t20883.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/t20883.nim')
-rw-r--r--tests/misc/t20883.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/misc/t20883.nim b/tests/misc/t20883.nim
new file mode 100644
index 000000000..92e7929f4
--- /dev/null
+++ b/tests/misc/t20883.nim
@@ -0,0 +1,13 @@
+discard """
+  action: reject
+nimout: '''
+t20883.nim(13, 4) template/generic instantiation of `foo` from here
+t20883.nim(9, 11) Error: cannot instantiate: 'U'
+'''
+"""
+
+proc foo*[U](x: U = U(1e-6)) =
+  echo x
+
+foo[float]()
+foo()