Fix pattern-case variable pretty-printer

This commit is contained in:
Chris Smowton
2024-03-22 15:42:51 +00:00
parent f66811048d
commit c0874ab04b

View File

@@ -1684,7 +1684,7 @@ class LocalVariableDeclExpr extends Expr, @localvariabledeclexpr {
exists(InstanceOfExpr ioe | this.getParent() = ioe | result.isNthChildOf(ioe, 1))
or
exists(PatternCase pc, int index, int typeAccessIdx | this.isNthChildOf(pc, index) |
(if index = 0 then typeAccessIdx = -4 else typeAccessIdx = (-3 - index)) and
(if index = 0 then typeAccessIdx = -2 else typeAccessIdx = (-3 - index)) and
result.isNthChildOf(pc, typeAccessIdx)
)
or