further preparations for 'opt' builtin type

This commit is contained in:
Andreas Rumpf
2017-10-09 20:43:58 +02:00
parent 740c07ead4
commit 6e337fe58a

View File

@@ -1400,7 +1400,7 @@ proc isGCedMem*(t: PType): bool {.inline.} =
t.kind == tyProc and t.callConv == ccClosure
proc propagateToOwner*(owner, elem: PType) =
const HaveTheirOwnEmpty = {tySequence, tySet, tyPtr, tyRef, tyProc}
const HaveTheirOwnEmpty = {tySequence, tyOpt, tySet, tyPtr, tyRef, tyProc}
owner.flags = owner.flags + (elem.flags * {tfHasMeta})
if tfNotNil in elem.flags:
if owner.kind in {tyGenericInst, tyGenericBody, tyGenericInvocation}:
@@ -1418,7 +1418,7 @@ proc propagateToOwner*(owner, elem: PType) =
if tfHasAsgn in elem.flags:
let o2 = elem.skipTypes({tyGenericInst, tyAlias})
if o2.kind in {tyTuple, tyObject, tyArray,
tySequence, tySet, tyDistinct}:
tySequence, tyOpt, tySet, tyDistinct}:
o2.flags.incl tfHasAsgn
owner.flags.incl tfHasAsgn