nitc :: AAttrPropdef :: create_lazy
see mlazypropdef
for more information about this property.
# Create the lazy attribute.
#
# see `mlazypropdef` for more information about this property.
fun create_lazy: AAttrPropdef
is
expect(has_value and mpropdef != null) # The only way to get a null `mpropdef` is when the attribute is defined as `abstract`. But if the attribute has a value, it cannot be abstract.
do
if self.mlazypropdef != null then return self # Self already has a `mlazypropdef`
is_lazy = true
var mlazyprop = new MAttribute(mpropdef.mclassdef, "lazy _" + name, self.location, none_visibility)
mlazyprop.is_fictive = true
var mlazypropdef = new MAttributeDef(mpropdef.mclassdef, mlazyprop, self.location)
mlazypropdef.is_fictive = true
self.mlazypropdef = mlazypropdef
return self
end
src/modelize/modelize_property.nit:1558,2--1573,4