var mt = mtype
if mt == null then return null
mt = mt.as_notnullable
- if mt isa MVirtualType or mt isa MParameterType then
+ if mt isa MFormalType then
res.add_class("nc_vt")
end
return mt.infobox(v)
# Now the case of direct null and nullable is over.
# If `sub` is a formal type, then it is accepted if its bound is accepted
- while sub isa MParameterType or sub isa MVirtualType do
+ while sub isa MFormalType do
#print "3.is {sub} a {sup}?"
# A unfixed formal type can only accept itself
assert sub isa MClassType # It is the only remaining type
# A unfixed formal type can only accept itself
- if sup isa MParameterType or sup isa MVirtualType then
+ if sup isa MFormalType then
return false
end
# Now the case of direct null and nullable is over.
# If `sub` is a formal type, then it is accepted if its bound is accepted
- while sub isa MParameterType or sub isa MVirtualType do
+ while sub isa MFormalType do
#print "3.is {sub} a {sup}?"
# A unfixed formal type can only accept itself
assert sub isa MClassType # It is the only remaining type
# A unfixed formal type can only accept itself
- if sup isa MParameterType or sup isa MVirtualType then
+ if sup isa MFormalType then
return false
end
# return type
var rmt = mpropdef.msignature.return_mtype
if rmt != null then
- if rmt isa MParameterType or rmt isa MVirtualType then
+ if rmt isa MFormalType then
var mclass_type = mpropdef.mclassdef.bound_mtype
rmt = rmt.anchor_to(mmodule, mclass_type)
end
# params
for p in mpropdef.msignature.mparameters do
var mtype = p.mtype.resolve_for(recv_type, recv_type, mmodule, true)
- if mtype isa MParameterType or mtype isa MVirtualType then
+ if mtype isa MFormalType then
var mclass_type = mpropdef.mclassdef.bound_mtype
mtype = mtype.anchor_to(mmodule, mclass_type)
end
if mtype == null then return
- if mtype isa MParameterType or mtype isa MVirtualType then
+ if mtype isa MFormalType then
mtype = mtype.anchor_to(mmodule, mclass_type)
end
var anchor = self.frame.arguments.first.mtype.as(MClassType)
# `sub` or `sup` are formal or virtual types, resolve them to concrete types
- if sub isa MParameterType or sub isa MVirtualType then
+ if sub isa MFormalType then
sub = sub.resolve_for(anchor.mclass.mclass_type, anchor, mainmodule, false)
end
- if sup isa MParameterType or sup isa MVirtualType then
+ if sup isa MFormalType then
sup = sup.resolve_for(anchor.mclass.mclass_type, anchor, mainmodule, false)
end
end
# Now the case of direct null and nullable is over
- if sub isa MParameterType or sub isa MVirtualType then
+ if sub isa MFormalType then
sub = sub.anchor_to(mainmodule, anchor)
# Manage the second layer of null/nullable
if sub isa MNullableType then