boolean (@Nullable PsiCaseLabelElement pattern) { if (pattern instanceof PsiTypeTestPattern) { PsiPatternVariable variable = ((PsiTypeTestPattern)pattern).getPatternVariable(); return variable != null && !variable.isUnnamed(); } else if (pattern instanceof PsiParenthesizedPattern) { return containsNamedPatternVariable(((PsiParenthesizedPattern)pattern).getPattern()); } else if (pattern instanceof PsiDeconstructionPattern) { PsiDeconstructionPattern deconstructionPattern = (PsiDeconstructionPattern)pattern; return deconstructionPattern.getPatternVariable() != null || ContainerUtil.exists(deconstructionPattern.getDeconstructionList().getDeconstructionComponents(), component -> containsNamedPatternVariable(component)); } return false; }