From 6e337fe58a85eca82d43150616e36e96f6290788 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Mon, 9 Oct 2017 20:43:58 +0200 Subject: [PATCH] further preparations for 'opt' builtin type --- compiler/ast.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 0a87e96153..97ff4b5930 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -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