modelize: do not crash is a upper VT bound is not set
authorJean Privat <jean@pryen.org>
Tue, 2 Dec 2014 16:18:11 +0000 (11:18 -0500)
committerJean Privat <jean@pryen.org>
Tue, 2 Dec 2014 16:18:11 +0000 (11:18 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/modelize/modelize_property.nit

index 046e74c..e04fd81 100644 (file)
@@ -1194,7 +1194,8 @@ redef class ATypePropdef
                # Check redefinitions
                bound = mpropdef.bound.as(not null)
                for p in mpropdef.mproperty.lookup_super_definitions(mmodule, anchor) do
-                       var supbound = p.bound.as(not null)
+                       var supbound = p.bound
+                       if supbound == null then break # broken super bound, skip error
                        if p.is_fixed then
                                modelbuilder.error(self, "Redef Error: Virtual type {mpropdef.mproperty} is fixed in super-class {p.mclassdef.mclass}")
                                break