model: silence warnings on multiple declaration of superclasses from artifical code
authorAlexis Laferrière <alexis.laf@xymus.net>
Mon, 21 Jul 2014 13:52:14 +0000 (09:52 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 22 Jul 2014 18:21:34 +0000 (14:21 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/modelize_class.nit

index 09b7081..5f99e51 100644 (file)
@@ -380,7 +380,10 @@ redef class ModelBuilder
                                assert mtype isa MClassType
                                var sc = mtype.mclass
                                if not parents.has(sc) or sc == objectclass then
-                                       warning(ntype, "Warning: superfluous super-class {mtype} in class {mclassdef.mclass}.")
+                                       # Skip the warning on generated code
+                                       if ntype.location.file != null and not ntype.location.file.filename.is_empty then
+                                               warning(ntype, "Warning: superfluous super-class {mtype} in class {mclassdef.mclass}.")
+                                       end
                                else if not seen_parents.has_key(sc) then
                                        seen_parents[sc] = ntype
                                else