boolean (@NotNull PsiElement element, @NotNull ResolveState state) { if (element instanceof PsiLocalVariable var) { if (!matcher.prefixMatches(var.getName())) { return true; } final PsiExpression expression = var.getInitializer(); if (expression instanceof PsiTypeCastExpression typeCastExpression) { final PsiExpression operand = typeCastExpression.getOperand(); if (operand != null && map.get(operand).contains(typeCastExpression.getType())) { map.remove(operand); } } } return true; }