var mreadpropdef = npropdef.mreadpropdef
if mreadpropdef == null or mreadpropdef.msignature == null then return # Skip broken attribute
if npropdef.noinit then continue # Skip noinit attribute
- var atautoinit = npropdef.get_single_annotation("autoinit", self)
- if atautoinit != null then
- # For autoinit attributes, call the reader to force
+ var atlateinit = npropdef.get_single_annotation("lateinit", self)
+ if atlateinit != null then
+ # For lateinit attributes, call the reader to force
# the lazy initialization of the attribute.
initializers.add(mreadpropdef.mproperty)
mreadpropdef.mproperty.is_autoinit = true
end
var atlazy = self.get_single_annotation("lazy", modelbuilder)
- var atautoinit = self.get_single_annotation("autoinit", modelbuilder)
- if atlazy != null or atautoinit != null then
- if atlazy != null and atautoinit != null then
- modelbuilder.error(atlazy, "Error: `lazy` incompatible with `autoinit`.")
+ var atlateinit = self.get_single_annotation("lateinit", modelbuilder)
+ if atlazy != null or atlateinit != null then
+ if atlazy != null and atlateinit != null then
+ modelbuilder.error(atlazy, "Error: `lazy` incompatible with `lateinit`.")
return
end
if not has_value then
if atlazy != null then
modelbuilder.error(atlazy, "Error: `lazy` attributes need a value.")
- else if atautoinit != null then
- modelbuilder.error(atautoinit, "Error: `autoinit` attributes need a value.")
+ else if atlateinit != null then
+ modelbuilder.error(atlateinit, "Error: `lateinit` attributes need a value.")
end
has_value = true
return
var b: Object is noautoinit
#alt1#var b2: Object = get(-4) is noautoinit
var c: Object is noautoinit
- var d: Object = get(2) is autoinit
- #alt2#var d2: Object = get(-2) is autoinit, lazy
+ var d: Object = get(2) is lateinit
+ #alt2#var d2: Object = get(-2) is lateinit, lazy
var e: Object = get(1)
fun setc(v: Object) is autoinit do self.c = get(v)
init do