From: Jean Privat Date: Fri, 28 Nov 2014 13:34:09 +0000 (-0500) Subject: modelize: do not crash if not object class to implicitly bound formal parameter X-Git-Tag: v0.7~83^2~7 X-Git-Url: http://nitlanguage.org modelize: do not crash if not object class to implicitly bound formal parameter Signed-off-by: Jean Privat --- diff --git a/src/modelize/modelize_class.nit b/src/modelize/modelize_class.nit index 441a6c2..79cab6e 100644 --- a/src/modelize/modelize_class.nit +++ b/src/modelize/modelize_class.nit @@ -168,6 +168,10 @@ redef class ModelBuilder warning(nfdt, "useless-bound", "Warning: Useless formal parameter type since `{bound}` cannnot have subclasses.") end else if mclass.mclassdefs.is_empty then + if objectclass == null then + error(nfd, "Error: Formal parameter type `{pname}' unbounded but no Object class exist.") + return + end # No bound, then implicitely bound by nullable Object var bound = objectclass.mclass_type.as_nullable bounds.add(bound)