nitc: remove a warning on casts on MMTypeFormal
authorJean Privat <jean@pryen.org>
Tue, 6 Nov 2012 19:03:05 +0000 (14:03 -0500)
committerJean Privat <jean@pryen.org>
Tue, 6 Nov 2012 20:38:29 +0000 (15:38 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/syntax/typing.nit

index db0b46c..c3ef59c 100644 (file)
@@ -2049,7 +2049,10 @@ abstract class ATypeCheckExpr
                if etype == ttype then
                        v.warning(self, "Warning: Expression is already a {ttype}.")
                else if etype < ttype then
-                       v.warning(self, "Warning: Expression is already a {ttype} since it is a {etype}.")
+                       if not ttype isa MMTypeFormal then
+                               # the old metamodel is not that great with formal types
+                               v.warning(self, "Warning: Expression is already a {ttype} since it is a {etype}.")
+                       end
                else if etype isa MMTypeNone then
                        # ttype is not nullable because of prevous test
                        v.warning(self, "Warning: Expression is null therefore cannot be a {ttype}.")