Class VariableScopeVisitor.InstanceofFlowBindings

java.lang.Object
org.codehaus.groovy.classgen.VariableScopeVisitor.InstanceofFlowBindings
Enclosing class:
VariableScopeVisitor

public static final class VariableScopeVisitor.InstanceofFlowBindings extends Object
Flow-sensitive result for JEP 394 instanceof pattern bindings (GROOVY-12242) — the Groovy equivalent of the JLS §6.3.1 “introduced by” sets.

One type, two views of the same analysis:

VariableScopeVisitor runs the analysis once via of(org.codehaus.groovy.ast.expr.Expression), declares from the variable lists, and attaches this instance as AST metadata (put(org.codehaus.groovy.ast.ASTNode, org.codehaus.groovy.classgen.VariableScopeVisitor.InstanceofFlowBindings)/get(org.codehaus.groovy.ast.ASTNode)). Later phases must use get(org.codehaus.groovy.ast.ASTNode) only — never re-call of(org.codehaus.groovy.ast.expr.Expression) on the condition.

Covered shapes: e instanceof T t, e !instanceof T t (native form and !(e instanceof T t)), !expr, a && b, a || b. All other shapes yield EMPTY (conservative: no definite bindings).

Since:
6.0.0
See Also: