# Return the nullable version of the type
# If the type is already nullable then self is returned
- #
- # FIXME: DO NOT WORK YET
fun as_nullable: MType
do
var res = self.as_nullable_cache
end
# A type prefixed with "nullable"
-# FIXME Stub implementation
class MNullableType
super MType
#
# This method is used to determine what method is called by a super.
#
- # FIXME: IMPLEMENTED AS A static designation, it is ugly
- #
# REQUIRE: not mtype.need_anchor
fun lookup_next_definition(mmodule: MModule, mtype: MType): MPROPDEF
do
# Check that non nullable attributes of `recv' are correctly initialized.
# This function is used as the last instruction of a new
- # FIXME: this will work better once there is nullable types
fun check_init_instance(recv: Instance)
do
if not recv isa MutableInstance then return
# stantard call-next-method
var mpropdef = v.frame.mpropdef
- # FIXME: we do not want an ugly static call!
mpropdef = mpropdef.lookup_next_definition(v.mainmodule, recv.mtype)
assert mpropdef isa MMethodDef
var res = v.call(mpropdef, args)