From 340bfacc5aa19f8c6b05ddf4023617a7d396f434 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Fri, 15 Jun 2007 08:14:59 +0000 Subject: [PATCH] fix type checking. We now complain about wrong type declarations --- Robust/src/IR/Tree/SemanticCheck.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Robust/src/IR/Tree/SemanticCheck.java b/Robust/src/IR/Tree/SemanticCheck.java index d9b21abe..2e2bd5e2 100644 --- a/Robust/src/IR/Tree/SemanticCheck.java +++ b/Robust/src/IR/Tree/SemanticCheck.java @@ -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(); -- 2.34.1