Skip to content

Commit

Permalink
Call extendWithNode on DeconstructorPatternNode. (#6217)
Browse files Browse the repository at this point in the history
  • Loading branch information
smillst authored Oct 3, 2023
1 parent b22d4cc commit 6fb842d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,11 @@ public Node visitDeconstructionPattern21(Tree deconstructionPatternTree, Void p)
for (Tree pattern : nestedPatternTrees) {
nestedPatterns.add(scan(pattern, p));
}

return new DeconstructorPatternNode(
TreeUtils.typeOf(deconstructionPatternTree), deconstructionPatternTree, nestedPatterns);
DeconstructorPatternNode dcpN =
new DeconstructorPatternNode(
TreeUtils.typeOf(deconstructionPatternTree), deconstructionPatternTree, nestedPatterns);
extendWithNode(dcpN);
return dcpN;
}

/* --------------------------------------------------------- */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.checkerframework.dataflow.cfg.node.CaseNode;
import org.checkerframework.dataflow.cfg.node.ClassNameNode;
import org.checkerframework.dataflow.cfg.node.ConditionalNotNode;
import org.checkerframework.dataflow.cfg.node.DeconstructorPatternNode;
import org.checkerframework.dataflow.cfg.node.EqualToNode;
import org.checkerframework.dataflow.cfg.node.ExpressionStatementNode;
import org.checkerframework.dataflow.cfg.node.FieldAccessNode;
Expand Down Expand Up @@ -968,6 +969,14 @@ public TransferResult<V, S> visitMethodInvocation(
finishValue(resValue, thenStore, elseStore), thenStore, elseStore);
}

@Override
public TransferResult<V, S> visitDeconstructorPattern(
DeconstructorPatternNode n, TransferInput<V, S> in) {
// TODO: Implement getting the type of a DeconstructorPatternTree.
V value = null;
return createTransferResult(value, in);
}

@Override
public TransferResult<V, S> visitInstanceOf(InstanceOfNode node, TransferInput<V, S> in) {
TransferResult<V, S> result = super.visitInstanceOf(node, in);
Expand Down

0 comments on commit 6fb842d

Please sign in to comment.