Fix record pattern and pretty-printing

This commit is contained in:
Chris Smowton
2023-11-22 14:36:21 +00:00
parent 419d530a06
commit 4bff7953fc
4 changed files with 45 additions and 10 deletions

View File

@@ -1672,6 +1672,8 @@ class LocalVariableDeclExpr extends Expr, @localvariabledeclexpr {
exists(InstanceOfExpr ioe | this.getParent() = ioe | result.isNthChildOf(ioe, 1))
or
exists(PatternCase pc | this.getParent() = pc | result.isNthChildOf(pc, -2))
or
exists(RecordPatternExpr rpe, int index | this.isNthChildOf(rpe, index) and result.isNthChildOf(rpe, -(index + 1)) )
}
/** Gets the name of the variable declared by this local variable declaration expression. */