PsiType (PsiVariable copyVariable) { PsiType type = copyVariable.getType(); PsiClass refClass = PsiUtil.resolveClassInType(type); if (refClass instanceof PsiAnonymousClass anonymousClass) { type = anonymousClass.getBaseClassType(); } return type; }