summary refs log tree commit diff stats
path: root/tests/vm/tref.nim
diff options
context:
space:
mode:
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