Program: 130538
Project: 130538
Buggy source:
@NotNull public ResolveToKind kind(){
  PsiElement tempElement=getParent();
  if (tempElement instanceof CSharpGenericConstraintImpl) {
    DotNetGenericParameterListOwner parameterListOwner=PsiTreeUtil.getParentOfType(this,DotNetGenericParameterListOwner.class);
    if (parameterListOwner == null) {
      return ResolveToKind.ANY_MEMBER;
    }
    return ResolveToKind.TYPE_PARAMETER_FROM_PARENT;
  }
 else   if (tempElement instanceof CSharpNamespaceDeclarationImpl) {
    return ResolveToKind.SOFT_NAMESPACE;
  }
 else   if (tempElement instanceof DotNetReferenceType) {
    PsiElement parentOfParent=tempElement.getParent();
    if (parentOfParent instanceof CSharpMethodCallParameterListOwner && ((CSharpMethodCallParameterListOwner)parentOfParent).canResolve()) {
      return ResolveToKind.CONSTRUCTOR;
    }
    return ResolveToKind.TYPE_OR_GENERIC_PARAMETER_OR_DELEGATE_METHOD;
  }
 else   if (tempElement instanceof CSharpUsingNamespaceStatementImpl) {
    return ResolveToKind.NAMESPACE;
  }
 else   if (tempElement instanceof CSharpConstructorSuperCallImpl) {
    return ResolveToKind.CONSTRUCTOR;
  }
 else   if (tempElement instanceof CSharpAttributeImpl) {
    return ResolveToKind.ATTRIBUTE;
  }
 else   if (tempElement instanceof CSharpFieldOrPropertySet) {
    if (((CSharpFieldOrPropertySet)tempElement).getNameReferenceExpression() == this) {
      return ResolveToKind.FIELD_OR_PROPERTY;
    }
  }
 else   if (tempElement instanceof CSharpReferenceExpressionImpl) {
    CSharpNamespaceDeclarationImpl netNamespaceDeclaration=PsiTreeUtil.getParentOfType(this,CSharpNamespaceDeclarationImpl.class);
    if (netNamespaceDeclaration != null) {
      DotNetReferenceExpression namespaceReference=netNamespaceDeclaration.getNamespaceReference();
      if (namespaceReference != null && PsiTreeUtil.isAncestor(namespaceReference,this,false)) {
        return ResolveToKind.SOFT_NAMESPACE;
      }
    }
    if (PsiTreeUtil.getParentOfType(this,CSharpUsingNamespaceStatementImpl.class) != null) {
      return ResolveToKind.NAMESPACE;
    }
    if (PsiTreeUtil.getParentOfType(this,DotNetReferenceType.class) != null) {
      return ResolveToKind.NAMESPACE;
    }
  }
 else   if (tempElement instanceof CSharpMethodCallExpressionImpl) {
    return ResolveToKind.METHOD;
  }
 else   if (tempElement instanceof CSharpGotoStatementImpl) {
    return ResolveToKind.LABEL;
  }
  tempElement=findChildByType(CSharpTokenSets.NATIVE_TYPES);
  if (tempElement != null) {
    return ResolveToKind.NATIVE_TYPE_WRAPPER;
  }
  tempElement=findChildByType(CSharpTokens.THIS_KEYWORD);
  if (tempElement != null) {
    return ResolveToKind.THIS;
  }
  tempElement=findChildByType(CSharpTokens.BASE_KEYWORD);
  if (tempElement != null) {
    return ResolveToKind.BASE;
  }
  return ResolveToKind.ANY_MEMBER;
}

Fixed version (ground truth):
@NotNull public ResolveToKind kind(){
  PsiElement tempElement=getParent();
  if (tempElement instanceof CSharpGenericConstraintImpl) {
    DotNetGenericParameterListOwner parameterListOwner=PsiTreeUtil.getParentOfType(this,DotNetGenericParameterListOwner.class);
    if (parameterListOwner == null) {
      return ResolveToKind.ANY_MEMBER;
    }
    return ResolveToKind.TYPE_PARAMETER_FROM_PARENT;
  }
 else   if (tempElement instanceof CSharpNamespaceDeclarationImpl) {
    return ResolveToKind.SOFT_NAMESPACE;
  }
 else   if (tempElement instanceof DotNetReferenceType) {
    PsiElement parentOfParent=tempElement.getParent();
    if (parentOfParent instanceof DotNetTypeWithTypeArguments) {
      parentOfParent=parentOfParent.getParent();
    }
    if (parentOfParent instanceof CSharpMethodCallParameterListOwner && ((CSharpMethodCallParameterListOwner)parentOfParent).canResolve()) {
      return ResolveToKind.CONSTRUCTOR;
    }
    return ResolveToKind.TYPE_OR_GENERIC_PARAMETER_OR_DELEGATE_METHOD;
  }
 else   if (tempElement instanceof CSharpUsingNamespaceStatementImpl) {
    return ResolveToKind.NAMESPACE;
  }
 else   if (tempElement instanceof CSharpConstructorSuperCallImpl) {
    return ResolveToKind.CONSTRUCTOR;
  }
 else   if (tempElement instanceof CSharpAttributeImpl) {
    return ResolveToKind.ATTRIBUTE;
  }
 else   if (tempElement instanceof CSharpFieldOrPropertySet) {
    if (((CSharpFieldOrPropertySet)tempElement).getNameReferenceExpression() == this) {
      return ResolveToKind.FIELD_OR_PROPERTY;
    }
  }
 else   if (tempElement instanceof CSharpReferenceExpressionImpl) {
    CSharpNamespaceDeclarationImpl netNamespaceDeclaration=PsiTreeUtil.getParentOfType(this,CSharpNamespaceDeclarationImpl.class);
    if (netNamespaceDeclaration != null) {
      DotNetReferenceExpression namespaceReference=netNamespaceDeclaration.getNamespaceReference();
      if (namespaceReference != null && PsiTreeUtil.isAncestor(namespaceReference,this,false)) {
        return ResolveToKind.SOFT_NAMESPACE;
      }
    }
    if (PsiTreeUtil.getParentOfType(this,CSharpUsingNamespaceStatementImpl.class) != null) {
      return ResolveToKind.NAMESPACE;
    }
    if (PsiTreeUtil.getParentOfType(this,DotNetReferenceType.class) != null) {
      return ResolveToKind.NAMESPACE;
    }
  }
 else   if (tempElement instanceof CSharpMethodCallExpressionImpl) {
    return ResolveToKind.METHOD;
  }
 else   if (tempElement instanceof CSharpGotoStatementImpl) {
    return ResolveToKind.LABEL;
  }
  tempElement=findChildByType(CSharpTokenSets.NATIVE_TYPES);
  if (tempElement != null) {
    return ResolveToKind.NATIVE_TYPE_WRAPPER;
  }
  tempElement=findChildByType(CSharpTokens.THIS_KEYWORD);
  if (tempElement != null) {
    return ResolveToKind.THIS;
  }
  tempElement=findChildByType(CSharpTokens.BASE_KEYWORD);
  if (tempElement != null) {
    return ResolveToKind.BASE;
  }
  return ResolveToKind.ANY_MEMBER;
}