compiler: no-on for `AIsaExpr` without a valid `cast_type`
authorJean Privat <jean@pryen.org>
Tue, 16 Jun 2015 14:50:28 +0000 (10:50 -0400)
committerJean Privat <jean@pryen.org>
Tue, 16 Jun 2015 14:50:28 +0000 (10:50 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/compiler/abstract_compiler.nit

index 221e628..8fae169 100644 (file)
@@ -3044,7 +3044,9 @@ redef class AIsaExpr
        redef fun expr(v)
        do
                var i = v.expr(self.n_expr, null)
-               return v.type_test(i, self.cast_type.as(not null), "isa")
+               var cast_type = self.cast_type
+               if cast_type == null then return null # no-no on broken node
+               return v.type_test(i, cast_type, "isa")
        end
 end