void (@NotNull PsiTypeElement parent) { super.visitTypeElement(parent); final PsiElement pparent = parent.getParent(); if (pparent instanceof PsiMethod && parent.equals(((PsiMethod)pparent).getReturnTypeElement())) { final PsiMethod method = (PsiMethod)pparent; final MethodSignature signature = method.getSignature(substitutor); if (PsiUtil.isAccessible(method, inheritingClass, null)) { final PsiMethod inInheritor = MethodSignatureUtil.findMethodBySignature(inheritingClass, signature, false); if (inInheritor != null && inInheritor.getReturnTypeElement() != null) { addLink(instantiation, method.getReturnTypeElement()); addLink(method.getReturnTypeElement(), instantiation); } } } else if (pparent instanceof PsiParameter parameter) { if (parameter.getDeclarationScope() instanceof PsiMethod method) { final int index = ((PsiParameterList)parameter.getParent()).getParameterIndex(parameter); final MethodSignature signature = method.getSignature(substitutor); if (PsiUtil.isAccessible(method, inheritingClass, null)) { final PsiMethod inInheritor = MethodSignatureUtil.findMethodBySignature(inheritingClass, signature, false); if (inInheritor != null) { final PsiParameter[] inheritorParams = inInheritor.getParameterList().getParameters(); LOG.assertTrue(inheritorParams.length > index); final PsiTypeElement hisTypeElement = inheritorParams[index].getTypeElement(); addLink(instantiation, hisTypeElement); addLink(hisTypeElement, instantiation); } } } } }