summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2018-08-23 12:32:40 +0200
committerLemonBoy <thatlemon@gmail.com>2018-09-22 20:47:49 +0200
commit7a087ffb2929cf09fe5dd27f01b06122463d6b9c (patch)
treef02f6f72f2444b5cdd6ecb27ff1bd246dcda9361 /tests
parent9707b232587b73f319ca3cd527a8bef15c813354 (diff)
downloadNim-7a087ffb2929cf09fe5dd27f01b06122463d6b9c.tar.gz
nil strings are movable
Diffstat (limited to 'tests')
-rw-r--r--tests/ccgbugs/tassign_nil_strings.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ccgbugs/tassign_nil_strings.nim b/tests/ccgbugs/tassign_nil_strings.nim
new file mode 100644
index 000000000..07d2c2aeb
--- /dev/null
+++ b/tests/ccgbugs/tassign_nil_strings.nim
@@ -0,0 +1,13 @@
+discard """
+  cmd: "nim $target --nilseqs:off $options $file"
+  output: "Hello"
+  ccodecheck: "\\i@'a = ((NimStringDesc*) NIM_NIL)'"
+"""
+
+proc main() =
+  var a = "Hello"
+  echo a
+  a = ""
+  doAssert a.len == 0
+
+main()