PatternVariableCandidate (@NotNull BasicBlockStatement blockStatement, @NotNull VarExprent varExprent, @NotNull VarExprent candidate) { Statement parent = blockStatement.getParent(); if (!(parent instanceof SequenceStatement parentSequenceStatement)) { return null; } int indexOfBlock = parentSequenceStatement.getStats().indexOf(blockStatement); if (indexOfBlock != 0) { return null; } RecordVarExprent recordVarExprent = new RecordVarExprent(candidate); VarTracker varTracker = new VarTracker(recordVarExprent); varTracker.put(varExprent, recordVarExprent, null); return findRecordPatternCandidate(parentSequenceStatement, varTracker); }