typing: generalize warning on useless type tests.
authorJean Privat <jean@pryen.org>
Thu, 24 Jul 2014 18:03:54 +0000 (14:03 -0400)
committerJean Privat <jean@pryen.org>
Thu, 24 Jul 2014 18:37:23 +0000 (14:37 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/typing.nit

index 2a21437..9cd96c6 100644 (file)
@@ -191,7 +191,7 @@ private class TypeVisitor
 
                if sup == sub then
                        self.modelbuilder.warning(node, "Warning: Expression is already a {sup}.")
-               else if self.is_subtype(sub, sup) and not sup.need_anchor then
+               else if self.is_subtype(sub, sup) then
                        self.modelbuilder.warning(node, "Warning: Expression is already a {sup} since it is a {sub}.")
                end
                return sup