From 05f8e4e5c9d24ef16db9213ac7346a3406db3eca Mon Sep 17 00:00:00 2001 From: stephey Date: Tue, 29 Mar 2011 22:54:40 +0000 Subject: [PATCH] Added an error case --- Robust/src/IR/Tree/SemanticCheck.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Robust/src/IR/Tree/SemanticCheck.java b/Robust/src/IR/Tree/SemanticCheck.java index 9b68aa0b..14c3e6dc 100644 --- a/Robust/src/IR/Tree/SemanticCheck.java +++ b/Robust/src/IR/Tree/SemanticCheck.java @@ -611,6 +611,8 @@ public class SemanticCheck { fd = new FieldDescriptor(new Modifiers(Modifiers.PUBLIC|Modifiers.FINAL), new TypeDescriptor(TypeDescriptor.INT), fieldname, null, false); fd.setAsEnum(); fd.setEnumValue(value); + } else if(fd == null) { + throw new Error("Could not find field "+ fieldname + " in "+fan.printNode(0)+" in "+md + " (Line: "+fan.getNumLine()+")"); } else if(fd.isStatic()) { // check if this field is a static field if(fd.getExpressionNode() != null) { -- 2.34.1