typing: reject literal arrays made of `null` (because they are untypable)
authorJean Privat <jean@pryen.org>
Sun, 4 Jan 2015 21:39:28 +0000 (16:39 -0500)
committerJean Privat <jean@pryen.org>
Sun, 4 Jan 2015 21:39:28 +0000 (16:39 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/semantize/typing.nit

index 1dfaec6..9d24a21 100644 (file)
@@ -1243,7 +1243,7 @@ redef class AArrayExpr
                if mtype == null then
                        mtype = v.merge_types(self, mtypes)
                end
-               if mtype == null then
+               if mtype == null or mtype isa MNullType then
                        v.error(self, "Type Error: ambiguous array type {mtypes.join(" ")}")
                        return
                end