From 8fba8178fb82614951cdea676d286379320e1d69 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Fri, 3 Apr 2015 09:34:36 +0700 Subject: [PATCH] modelbuilder: resolve_mtype does not crash when the class is incomplete Signed-off-by: Jean Privat --- src/modelbuilder_base.nit | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modelbuilder_base.nit b/src/modelbuilder_base.nit index 9995338..f01fbd8 100644 --- a/src/modelbuilder_base.nit +++ b/src/modelbuilder_base.nit @@ -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 -- 1.7.9.5