rta: store real types in live_cast_type
[nit.git] / src / modelize_class.nit
index e96877d..e8a207b 100644 (file)
@@ -76,6 +76,10 @@ redef class ModelBuilder
 
                var mclass = try_get_mclass_by_name(nclassdef, mmodule, name)
                if mclass == null then
+                       if nclassdef isa AStdClassdef and nclassdef.n_kwredef != null then
+                               error(nclassdef, "Redef error: No imported class {name} to refine.")
+                               return
+                       end
                        mclass = new MClass(mmodule, name, arity, mkind, mvisibility)
                        #print "new class {mclass}"
                else if nclassdef isa AStdClassdef and nmodule.mclass2nclassdef.has_key(mclass) then
@@ -116,6 +120,10 @@ redef class ModelBuilder
                                        error(nfd, "Error: A formal parameter type `{ptname}' already exists")
                                        return
                                end
+                               for c in ptname do if c >= 'a' and c<= 'z' then
+                                       warning(nfd, "Warning: lowercase in the formal parameter type {ptname}")
+                                       break
+                               end
                                names.add(ptname)
                                nfd.mtype = mclass.mclass_type.arguments[i].as(MParameterType)
                        end