void (@NotNull PsiVariable variable) { super.visitVariable(variable); if (variable instanceof PsiPatternVariable) { PsiElement context = PsiTreeUtil.getParentOfType(variable, PsiInstanceOfExpression.class, PsiCaseLabelElementList.class, PsiForeachPatternStatement.class); if (!(context instanceof PsiForeachPatternStatement)) { HighlightingFeature feature = context instanceof PsiInstanceOfExpression ? HighlightingFeature.PATTERNS : HighlightingFeature.PATTERNS_IN_SWITCH; PsiIdentifier varIdentifier = ((PsiPatternVariable)variable).getNameIdentifier(); add(checkFeature(varIdentifier, feature)); } } try { if (!hasErrorResults()) add(HighlightUtil.checkVarTypeApplicability(variable)); if (!hasErrorResults()) add(HighlightUtil.checkVariableInitializerType(variable)); } catch (IndexNotReadyException ignored) { } }