@Override
  public void visitVariable(@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)) {
        JavaFeature feature = context instanceof PsiInstanceOfExpression ?
                              JavaFeature.PATTERNS :
                              JavaFeature.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) {
    }
  }
@Override
  public void visitVariable(@NotNull PsiVariable variable)