typing: ensure monotony on literal arrays
[nit.git] / src / semantize / typing.nit
index 212f43e..ba08e4d 100644 (file)
@@ -1334,6 +1334,8 @@ redef class AArrayExpr
                        end
                end
                if mtype == null then
+                       # Ensure monotony for type adaptation on loops
+                       if self.element_mtype != null then mtypes.add self.element_mtype
                        mtype = v.merge_types(self, mtypes)
                end
                if mtype == null or mtype isa MNullType then