oracle/graal · error · ElementException

Successor field must be a Node type

Error message

Successor field must be a Node type

What it means

A @Successor field that is not a NodeSuccessorList must have a type assignable to Node. Successors are control-flow edges of the graph and can only point at nodes; a successor typed as an arbitrary class or interface has no meaning to the graph machinery. The NodeInfo processor verifies this with erased-type assignability and fails the build otherwise.

Source

Thrown at compiler/src/jdk.graal.compiler.processor/src/jdk/graal/compiler/nodeinfo/processor/GraphNodeVerifier.java:154

                        }
                        if (modifiers.contains(FINAL)) {
                            throw new ElementException(field, "Input field must not be final");
                        }
                        if (modifiers.contains(PUBLIC)) {
                            throw new ElementException(field, "Input field must not be public");
                        }
                    }
                } else if (isSuccessor) {
                    if (isAssignableWithErasure(field, NodeSuccessorList)) {
                        if (modifiers.contains(FINAL)) {
                            throw new ElementException(field, "Successor list field must not be final");
                        }
                        if (modifiers.contains(PUBLIC)) {
                            throw new ElementException(field, "Successor list field must not be public");
                        }
                    } else {
                        if (!isAssignableWithErasure(field, Node)) {
                            throw new ElementException(field, "Successor field must be a Node type");
                        }
                        if (modifiers.contains(FINAL)) {
                            throw new ElementException(field, "Successor field must not be final");
                        }
                        if (modifiers.contains(PUBLIC)) {
                            throw new ElementException(field, "Successor field must not be public");
                        }
                    }

                } else {
                    if (isAssignableWithErasure(field, Node) && !field.getSimpleName().contentEquals("Null")) {
                        throw new ElementException(field, "Node field must be annotated with @" + Input.getSimpleName() + ", @" + OptionalInput.getSimpleName() + " or @" + Successor.getSimpleName());
                    }
                    if (isAssignableWithErasure(field, NodeInputList)) {
                        throw new ElementException(field, "NodeInputList field must be annotated with @" + Input.getSimpleName() + " or @" + OptionalInput.getSimpleName());
                    }
                    if (isAssignableWithErasure(field, NodeSuccessorList)) {
                        throw new ElementException(field, "NodeSuccessorList field must be annotated with @" + Successor.getSimpleName());

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Change the field type to a Node subtype (e.g. FixedNode, AbstractBeginNode, ValueNode).
  2. If the field is data or a value dependency, use @Input/@OptionalInput (and an interface/Node type) instead of @Successor.
  3. If a list of control-flow targets is needed, use NodeSuccessorList with @Successor.
  4. Rebuild to confirm.

Example fix

// before
@Successor
protected MyBlock next; // MyBlock does not extend Node

// after
@Successor
protected FixedWithNextNode next;
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: !isAssignableWithErasure(field, Node) on a @Successor field in the non-list branch (GraphNodeVerifier.java:153-155). Example: '@Successor protected Exception edge;' or '@Successor protected SomeInterface next;' where neither extends Node.

Common situations: Annotating a data or reference field with @Successor by mistake instead of @Input; renaming/mistyping the successor's type; using a wrapper class instead of the node itself as successor.

Related errors


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/74ded28619e84c40. Report an issue: GitHub.