summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorJason Beetham <beefers331@gmail.com>2021-07-27 01:36:59 -0600
committerGitHub <noreply@github.com>2021-07-27 09:36:59 +0200
commited44618deb7173ecfe41420fc90871b83a0d08ca (patch)
treed554d47f13d3a5b712e8c40182f1deeb411162e8 /tests
parentfa0209609d3bedd3466f162aa350d261907851ce (diff)
downloadNim-ed44618deb7173ecfe41420fc90871b83a0d08ca.tar.gz
Fixed const tuples in inferred generics (#18598)
Diffstat (limited to 'tests')
-rw-r--r--tests/tuples/tinferred_generic_const.nim14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/tuples/tinferred_generic_const.nim b/tests/tuples/tinferred_generic_const.nim
new file mode 100644
index 000000000..5ab730c38
--- /dev/null
+++ b/tests/tuples/tinferred_generic_const.nim
@@ -0,0 +1,14 @@
+discard """
+  action: run
+"""
+block:
+  proc something(a: string or int or float) =
+    const (c, d) = (default a.type, default a.type)
+
+block:
+  proc something(a: string or int) =
+    const c = default a.type
+
+block:
+  proc something(a: string or int) =
+    const (c, d, e) = (default a.type, default a.type, default a.type)