redef fun type_test(value, mtype, tag)
do
mtype = self.anchor(mtype)
- var mclasstype = mtype
- if mtype isa MNullableType then mclasstype = mtype.mtype
- assert mclasstype isa MClassType
- if not self.compiler.runtime_type_analysis.live_cast_types.has(mclasstype) then
+ if not self.compiler.runtime_type_analysis.live_cast_types.has(mtype) then
debug "problem: {mtype} was detected cast-dead"
abort
end
var live_classes = new HashSet[MClass]
# The pool of types used to perform type checks (isa and as).
- var live_cast_types = new HashSet[MClassType]
+ var live_cast_types = new HashSet[MType]
# The pool of undesolved types used to perform type checks (isa and as).
# They are globally resolved at the end of the analaysis
for t in live_types do
if not ot.can_resolve_for(t, t, mainmodule) then continue
var rt = ot.anchor_to(mainmodule, t)
- if rt isa MNullableType then rt = rt.mtype
- assert rt isa MClassType
live_cast_types.add(rt)
#print " {ot}/{t} -> {rt}"
end
fun add_cast(mtype: MType)
do
- if mtype isa MNullableType then mtype = mtype.mtype
if mtype.need_anchor then
live_open_cast_types.add(mtype)
else
- assert mtype isa MClassType
live_cast_types.add(mtype)
end
end