parent
d56848878c
commit
9fc04a555c
2 changed files with 19 additions and 1 deletions
|
|
@ -336,7 +336,7 @@ proc genAssignment(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) =
|
||||||
else:
|
else:
|
||||||
linefmt(p, cpsStmts, "$1 = $2;$n", [rdLoc(dest), rdLoc(src)])
|
linefmt(p, cpsStmts, "$1 = $2;$n", [rdLoc(dest), rdLoc(src)])
|
||||||
of tyArray:
|
of tyArray:
|
||||||
if containsGarbageCollectedRef(dest.t):
|
if containsGarbageCollectedRef(dest.t) and p.config.selectedGC notin {gcArc, gcOrc, gcHooks}:
|
||||||
genGenericAsgn(p, dest, src, flags)
|
genGenericAsgn(p, dest, src, flags)
|
||||||
else:
|
else:
|
||||||
linefmt(p, cpsStmts,
|
linefmt(p, cpsStmts,
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ discard """
|
||||||
Success
|
Success
|
||||||
@["a", "b", "c"]
|
@["a", "b", "c"]
|
||||||
Hello
|
Hello
|
||||||
|
1
|
||||||
|
2
|
||||||
0'''
|
0'''
|
||||||
cmd: '''nim c --gc:arc $file'''
|
cmd: '''nim c --gc:arc $file'''
|
||||||
"""
|
"""
|
||||||
|
|
@ -126,4 +128,20 @@ proc bug13119 =
|
||||||
|
|
||||||
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
|
echo getOccupiedMem() - startMem
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue