fix type checking. We now complain about wrong type declarations
authorbdemsky <bdemsky>
Fri, 15 Jun 2007 08:14:59 +0000 (08:14 +0000)
committerbdemsky <bdemsky>
Fri, 15 Jun 2007 08:14:59 +0000 (08:14 +0000)
Robust/src/IR/Tree/SemanticCheck.java

index d9b21abe8efbbb73379eb0e02eb547cd93b3ea8b..2e2bd5e2076a60d3ca252ba2f78ae53d0faa3281 100644 (file)
@@ -532,6 +532,11 @@ public class SemanticCheck {
        TypeDescriptor typetolookin=con.getType();
        checkTypeDescriptor(typetolookin);
 
+       if (td!=null&&!typeutil.isSuperorType(td, typetolookin))
+           throw new Error(typetolookin + " isn't a "+td);
+
+
+
        /* Check flag effects */
        if (con.getFlagEffects()!=null) {
            FlagEffects fe=con.getFlagEffects();