src: Modified compilers for the support of the new Integers
[nit.git] / src / modelize / modelize_property.nit
index 467fccd..824ac8c 100644 (file)
@@ -1347,11 +1347,16 @@ redef class AAttrPropdef
                        if nexpr != null then
                                if nexpr isa ANewExpr then
                                        mtype = modelbuilder.resolve_mtype_unchecked(mmodule, mclassdef, nexpr.n_type, true)
-                               else if nexpr isa AIntExpr then
-                                       var cla = modelbuilder.try_get_mclass_by_name(nexpr, mmodule, "Int")
-                                       if cla != null then mtype = cla.mclass_type
-                               else if nexpr isa AByteExpr then
-                                       var cla = modelbuilder.try_get_mclass_by_name(nexpr, mmodule, "Byte")
+                               else if nexpr isa AIntegerExpr then
+                                       var cla: nullable MClass = null
+                                       if nexpr.value isa Int then
+                                               cla = modelbuilder.try_get_mclass_by_name(nexpr, mmodule, "Int")
+                                       else if nexpr.value isa Byte then
+                                               cla = modelbuilder.try_get_mclass_by_name(nexpr, mmodule, "Byte")
+                                       else
+                                               # Should not happen, and should be updated as new types are added
+                                               abort
+                                       end
                                        if cla != null then mtype = cla.mclass_type
                                else if nexpr isa AFloatExpr then
                                        var cla = modelbuilder.try_get_mclass_by_name(nexpr, mmodule, "Float")