@Override
      protected boolean check(PsiVariable var, ResolveState state) {
        for (PsiElement element : declaration.getDeclaredElements()) {
          if (element == var || var instanceof LightElement) return false;
        }
        return TypeConversionUtil.isAssignable(var.getType(), type);
      }
@Override
      protected boolean check(PsiVariable var, ResolveState state)