diff options
-rw-r--r-- | compiler/semtypes.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index d1ea54eca..f4936a71a 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -141,7 +141,7 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType = if isPure and (let conflict = strTableInclReportConflict(symbols, e); conflict != nil): wrongRedefinition(c, e.info, e.name.s, conflict.info) inc(counter) - if not hasNull: incl(result.flags, tfNeedsInit) + if tfNotNil in e.typ.flags and not hasNull: incl(result.flags, tfNeedsInit) proc semSet(c: PContext, n: PNode, prev: PType): PType = result = newOrPrevType(tySet, prev, c) |