summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-05-14 13:59:41 +0800
committerGitHub <noreply@github.com>2023-05-14 13:59:41 +0800
commit0ece98620f8d9d7b874262c75fa148970626d44d (patch)
tree0bbf3127e9f91ab6d5f190c0f8f81003cf96f597
parentddce5559981ac5dedd3a5dfb210eb25296e69307 (diff)
downloadNim-0ece98620f8d9d7b874262c75fa148970626d44d.tar.gz
closes #7590; add a test case (#21846)
-rw-r--r--tests/vm/tvmmisc.nim20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/vm/tvmmisc.nim b/tests/vm/tvmmisc.nim
index 11fdcbd8c..f41a918f9 100644
--- a/tests/vm/tvmmisc.nim
+++ b/tests/vm/tvmmisc.nim
@@ -668,3 +668,23 @@ block: # bug #10108
     discard y2
     reject:
       const c5 = deliver_x()
+
+block: # bug #7590
+  proc doInit[T]():auto=
+    var a: T
+    return a
+
+  proc fun2[T](tup1:T)=
+    const tup0=doInit[T]()
+
+    # var tup=tup0 #ok
+    const tup=tup0 #causes bug
+
+    doAssert tup is tuple
+    doAssert tup[0] is tuple
+    for ai in tup.fields:
+      doAssert ai is tuple, "BUG2"
+
+  # const c=(foo:(bar1: 0.0))
+  const c=(foo:(bar1:"foo1"))
+  fun2(c)