mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-29 10:43:57 +00:00
VM fix for refs
This commit is contained in:
committed by
Andreas Rumpf
parent
6758fbd06e
commit
7cf87dfac6
12
tests/vm/tref.nim
Normal file
12
tests/vm/tref.nim
Normal file
@@ -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"
|
||||
Reference in New Issue
Block a user