void (PsiExpression expression) { if (!(expression instanceof PsiReferenceExpression referenceExpression)) { return; } final PsiExpression qualifierExpression = referenceExpression.getQualifierExpression(); if (qualifierExpression != null && !(qualifierExpression instanceof PsiThisExpression) && !(qualifierExpression instanceof PsiSuperExpression)) { return; } final PsiElement target = referenceExpression.resolve(); if (!(target instanceof PsiField field)) { return; } final PsiClass fieldClass = field.getContainingClass(); if (fieldClass == null) { return; } final PsiMethod method = PsiTreeUtil.getParentOfType(expression, PsiMethod.class, true, PsiClass.class, PsiLambdaExpression.class); if (method == null || !method.isConstructor()) { return; } final PsiClass assignmentClass = method.getContainingClass(); final String name = fieldClass.getQualifiedName(); if (name == null || !InheritanceUtil.isInheritor(assignmentClass, true, name)) { return; } registerError(expression, referenceExpression, fieldClass); }