Truffle Specializations do not automatically have exclusive semantics. Instead, the rules of the Java type system apply.
Let's take the following node with three specializations as example.
Note, I return an int
here, usually you'd return a boolean, but the int
allows me to get the point across more precisely in the later tests.
@NodeChild(value = "e", type = ExprNode.class)
public abstract class IsNumberNode extends Node {