ExpectedTypeMatching (@Nullable String expectedMemberName, @Nullable PsiType itemType) { if (expectedMemberName != null) { PsiClass itemClass = PsiUtil.resolveClassInClassTypeOnly(itemType); if (itemClass != null) { if (itemClass.findMethodsByName(expectedMemberName, true).length > 0 || itemClass.findFieldByName(expectedMemberName, true) != null || itemClass.findInnerClassByName(expectedMemberName, true) != null) { return ExpectedTypeMatching.expected; } } } return ExpectedTypeMatching.normal; }