summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2017-07-13 17:07:33 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-07-13 17:07:33 +0200
commit52cab78ae57b5a36c7e05c41fa23a55b8302b2ee (patch)
tree5c0a4de9aff2febf92b06e033ef78f9503dac558 /tests
parent03e0aa37e3d41c77475a2484e9a3d084e26bd8bf (diff)
downloadNim-52cab78ae57b5a36c7e05c41fa23a55b8302b2ee.tar.gz
newLit emty seq fix (#6091)
* the type of the empty seq is still the correct type
* updated test
Diffstat (limited to 'tests')
-rw-r--r--tests/macros/tnewlit.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/macros/tnewlit.nim b/tests/macros/tnewlit.nim
index 69245d076..3ba1e09e1 100644
--- a/tests/macros/tnewlit.nim
+++ b/tests/macros/tnewlit.nim
@@ -138,3 +138,12 @@ macro test_newLit_ComposedType: untyped =
   result = newLit(ct)
 
 doAssert test_newLit_ComposedType == ComposedType(mt: MyType(a: 123, b:"abc"), arr: [1,2,3,4], data: @[1.byte, 3, 7, 127])
+
+macro test_newLit_empty_seq_string: untyped =
+  var strSeq = newSeq[string](0)
+  result = newLit(strSeq)
+
+block:
+  # x needs to be of type seq[string]
+  var x = test_newLit_empty_seq_string
+  x.add("xyz")