mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-19 23:41:29 +00:00
@@ -99,7 +99,7 @@ proc genTraverseProc(c: TTraversalClosure, accessor: Rope, typ: PType) =
|
||||
of tyRef:
|
||||
lineCg(p, cpsStmts, visitorFrmt, [accessor, c.visitorFrmt])
|
||||
of tySequence:
|
||||
if tfHasAsgn notin typ.flags:
|
||||
if optSeqDestructors notin c.p.module.config.globalOptions:
|
||||
lineCg(p, cpsStmts, visitorFrmt, [accessor, c.visitorFrmt])
|
||||
elif containsGarbageCollectedRef(typ.lastSon):
|
||||
# destructor based seqs are themselves not traced but their data is, if
|
||||
|
||||
@@ -147,3 +147,21 @@ proc newMySeq*[T](size: int, initial_value: T): MySeq[T] =
|
||||
|
||||
let x = makeShared(newMySeq(10, 1.0))
|
||||
doAssert: x.get().len == 10
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
#bug #12882
|
||||
|
||||
type
|
||||
ValueObject = object
|
||||
v: MySeq[int]
|
||||
name: string
|
||||
|
||||
TopObject = object
|
||||
internal: seq[ValueObject]
|
||||
|
||||
var zz = new(TopObject)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user