Added an error case
authorstephey <stephey>
Tue, 29 Mar 2011 22:54:40 +0000 (22:54 +0000)
committerstephey <stephey>
Tue, 29 Mar 2011 22:54:40 +0000 (22:54 +0000)
Robust/src/IR/Tree/SemanticCheck.java

index 9b68aa0bedd03c8b3c8324715d47f34686563dd8..14c3e6dc453e52a86530e57e071f39350ec40353 100644 (file)
@@ -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) {