[ClavaAst] Checks if Expr data has a TYPE
@@ -20,6 +20,8 @@ import org.suikasoft.jOptions.Datakey.DataKey;
import org.suikasoft.jOptions.Datakey.KeyFactory;
import org.suikasoft.jOptions.Interfaces.DataStore;
+import com.google.common.base.Preconditions;
+
import pt.up.fe.specs.clava.ClavaNode;
import pt.up.fe.specs.clava.ClavaNodeInfo;
import pt.up.fe.specs.clava.ClavaNodes;
@@ -57,6 +59,9 @@ public abstract class Expr extends ClavaNode implements Typable {
public Expr(DataStore data, Collection<? extends ClavaNode> children) {
super(data, children);
+
+ // Type is required
+ Preconditions.checkArgument(data.hasValue(TYPE), "Expected data of Expr node to have a defined TYPE");
}
/**
