Rename REAMDE to README.md
[nit.git] / src / rapid_type_analysis.nit
index bcae37f..81e14fa 100644 (file)
@@ -93,7 +93,7 @@ class RapidTypeAnalysis
                var mtype = callsite.recv
                var anchor = callsite.anchor
                if anchor != null then mtype = mtype.anchor_to(callsite.mmodule, anchor)
-               mtype = mtype.as_notnullable
+               mtype = mtype.undecorate
                if mtype isa MClassType then mtype = mtype.mclass.intro.bound_mtype
                var mproperty = callsite.mproperty
                var res = live_targets_cache[mtype, mproperty]
@@ -321,7 +321,7 @@ class RapidTypeAnalysis
        do
                var d = mtype.length
                if d > 255 then
-                       self.modelbuilder.toolcontext.fatal_error(null, "Fatal error: limitation in the rapidtype analysis engine: a type depth of {d} is too important, the problematic type is {mtype}.")
+                       self.modelbuilder.toolcontext.fatal_error(null, "Fatal Error: limitation in the rapidtype analysis engine: a type depth of {d} is too important, the problematic type is `{mtype}`.")
                end
        end
 
@@ -465,7 +465,7 @@ class RapidTypeVisitor
        do
                mtype = mtype.anchor_to(self.analysis.mainmodule, self.receiver)
                if mtype isa MNullType then return null
-               mtype = mtype.as_notnullable
+               mtype = mtype.undecorate
                assert mtype isa MClassType
                assert not mtype.need_anchor
                return mtype
@@ -540,6 +540,8 @@ redef class AArrayExpr
                mtype = v.cleanup_type(mtype).as(not null)
                var prop = v.get_method(mtype, "with_native")
                v.add_monomorphic_send(mtype, prop)
+               v.add_callsite(with_capacity_callsite)
+               v.add_callsite(push_callsite)
        end
 end
 
@@ -560,11 +562,13 @@ redef class ASuperstringExpr
                var object_type = mmodule.object_type
                var arraytype = mmodule.array_type(object_type)
                v.add_type(arraytype)
-               v.add_type(mmodule.native_array_type(object_type))
+               var nattype = mmodule.native_array_type(object_type)
+               v.add_type(nattype)
                var prop = v.get_method(arraytype, "join")
                v.add_monomorphic_send(arraytype, prop)
                var prop2 = v.get_method(arraytype, "with_native")
                v.add_monomorphic_send(arraytype, prop2)
+               v.add_monomorphic_send(nattype, v.get_method(nattype, "native_to_s"))
        end
 end