mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-17 08:34:20 +00:00
Merge pull request #3996 from arnetheduck/tshallowseq
add test for shallow seq copy
This commit is contained in:
17
tests/seq/tshallowseq.nim
Normal file
17
tests/seq/tshallowseq.nim
Normal file
@@ -0,0 +1,17 @@
|
||||
discard """
|
||||
output: '''@[1, 42, 3]
|
||||
@[1, 42, 3]
|
||||
'''
|
||||
"""
|
||||
proc xxx() =
|
||||
var x: seq[int] = @[1, 2, 3]
|
||||
var y: seq[int]
|
||||
|
||||
system.shallowCopy(y, x)
|
||||
|
||||
y[1] = 42
|
||||
|
||||
echo y
|
||||
echo x
|
||||
|
||||
xxx()
|
||||
Reference in New Issue
Block a user