void (PsiType ltype, PsiType rtype, GrBinaryExpression expression) { if (!(rtype instanceof PsiClassType)) return; if (!(ltype instanceof PsiClassType)) return; PsiClass lclass = ((PsiClassType)ltype).resolve(); PsiClass rclass = ((PsiClassType)rtype).resolve(); if (lclass == null || rclass == null) return; if (expression.getManager().areElementsEquivalent(lclass, rclass)) return; if (lclass.isInterface() || rclass.isInterface()) return; if (lclass.isInheritor(rclass, true) || rclass.isInheritor(lclass, true)) return; registerError(expression, ltype, rtype); }