More sophistication; Allow requiresInit to be specified per-field
This commit is contained in:
parent
a8b6222c86
commit
7652aede41
4 changed files with 61 additions and 15 deletions
|
|
@ -259,6 +259,7 @@ type
|
|||
# needed for the code generator
|
||||
sfProcvar, # proc can be passed to a proc var
|
||||
sfDiscriminant, # field is a discriminant in a record/object
|
||||
sfRequiresInit, # field must be initialized during construction
|
||||
sfDeprecated, # symbol is deprecated
|
||||
sfExplain, # provide more diagnostics when this symbol is used
|
||||
sfError, # usage of symbol should trigger a compile-time error
|
||||
|
|
@ -1488,7 +1489,7 @@ proc propagateToOwner*(owner, elem: PType; propagateHasAsgn = true) =
|
|||
elif owner.kind notin HaveTheirOwnEmpty:
|
||||
owner.flags.incl tfHasRequiresInit
|
||||
|
||||
if tfRequiresInit in elem.flags:
|
||||
if {tfRequiresInit, tfHasRequiresInit} * elem.flags != {}:
|
||||
if owner.kind in HaveTheirOwnEmpty: discard
|
||||
else: owner.flags.incl tfHasRequiresInit
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue