var mtype = callsite.recv
var anchor = callsite.anchor
if anchor != null then mtype = mtype.anchor_to(callsite.mmodule, anchor)
- if mtype isa MNullableType then mtype = mtype.mtype
+ mtype = mtype.as_notnullable
assert mtype isa MClassType
mtype = mtype.mclass.intro.bound_mtype
var mproperty = callsite.mproperty
if initprop != null then
add_send(maintype, initprop)
end
- var mainprop = mainmodule.try_get_primitive_method("main", maintype.mclass)
+ var mainprop = mainmodule.try_get_primitive_method("run", maintype.mclass) or else
+ mainmodule.try_get_primitive_method("main", maintype.mclass)
if mainprop != null then
add_send(maintype, mainprop)
end
do
mtype = mtype.anchor_to(self.analysis.mainmodule, self.receiver)
if mtype isa MNullType then return null
- if mtype isa MNullableType then mtype = mtype.mtype
+ mtype = mtype.as_notnullable
assert mtype isa MClassType
assert not mtype.need_anchor
return mtype