modelbuilder: resolve_mtype does not crash when the class is incomplete
[nit.git] / src / modelbuilder_base.nit
index 6cbcbef..f01fbd8 100644 (file)
@@ -305,7 +305,9 @@ class ModelBuilder
                if mtype isa MGenericType then
                        var mclass = mtype.mclass
                        for i in [0..mclass.arity[ do
-                               var bound = mclass.intro.bound_mtype.arguments[i]
+                               var intro = mclass.try_intro
+                               if intro == null then return null # skip error
+                               var bound = intro.bound_mtype.arguments[i]
                                var nt = ntype.n_types[i]
                                var mt = resolve_mtype(mmodule, mclassdef, nt)
                                if mt == null then return null # forward error
@@ -375,7 +377,7 @@ redef class ADoc
        do
                var res = mdoc_cache
                if res != null then return res
-               res = new MDoc
+               res = new MDoc(location)
                for c in n_comment do
                        var text = c.text
                        if text.length < 2 then