mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
@@ -336,7 +336,7 @@ proc genAssignment(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) =
|
||||
else:
|
||||
linefmt(p, cpsStmts, "$1 = $2;$n", [rdLoc(dest), rdLoc(src)])
|
||||
of tyArray:
|
||||
if containsGarbageCollectedRef(dest.t):
|
||||
if containsGarbageCollectedRef(dest.t) and p.config.selectedGC notin {gcArc, gcOrc, gcHooks}:
|
||||
genGenericAsgn(p, dest, src, flags)
|
||||
else:
|
||||
linefmt(p, cpsStmts,
|
||||
|
||||
@@ -4,6 +4,8 @@ discard """
|
||||
Success
|
||||
@["a", "b", "c"]
|
||||
Hello
|
||||
1
|
||||
2
|
||||
0'''
|
||||
cmd: '''nim c --gc:arc $file'''
|
||||
"""
|
||||
@@ -126,4 +128,20 @@ proc bug13119 =
|
||||
|
||||
bug13119()
|
||||
|
||||
# bug #13105
|
||||
|
||||
type
|
||||
Result[T, E] = object
|
||||
a: T
|
||||
b: E
|
||||
D = ref object
|
||||
x: int
|
||||
R = Result[D, int]
|
||||
|
||||
proc bug13105 =
|
||||
for n in [R(b: 1), R(b: 2)]:
|
||||
echo n.b
|
||||
|
||||
bug13105()
|
||||
|
||||
echo getOccupiedMem() - startMem
|
||||
|
||||
Reference in New Issue
Block a user