summary refs log tree commit diff stats
path: root/tests/vm/tref.nim
diff options
context:
space:
mode:
authorOscar NihlgÄrd <oscarnihlgard@gmail.com>2018-05-08 12:02:48 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-05-08 17:00:00 +0200
commit7cf87dfac62d68d1d9ef7fbedca05b9950b71ced (patch)
treef7be268192acaf512e50addbf3a3ce11312c00e7 /tests/vm/tref.nim
parent6758fbd06e5cd88b620939b60deb5bfa00345efc (diff)
downloadNim-7cf87dfac62d68d1d9ef7fbedca05b9950b71ced.tar.gz
VM fix for refs
Diffstat (limited to 'tests/vm/tref.nim')
-rw-r--r--tests/vm/tref.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/vm/tref.nim b/tests/vm/tref.nim
new file mode 100644
index 000000000..517a67fb0
--- /dev/null
+++ b/tests/vm/tref.nim
@@ -0,0 +1,12 @@
+static:
+  var
+    a: ref string
+    b: ref string
+  new a
+
+  a[] = "Hello world"
+  b = a
+
+  b[5] = 'c'
+  doAssert a[] == "Hellocworld"
+  doAssert b[] == "Hellocworld"
\ No newline at end of file