Program: 130443
Project: 130443
Buggy source:
@RequiredReadAction @Nullable @Override public CompilerCheckBuilder checkImpl(@NotNull CSharpLanguageVersion languageVersion,@NotNull PsiElement element){
  val resolve=resolve(element);
  if (resolve == null) {
    return null;
  }
  DotNetTypeRef firstTypeRef=resolve.getFirst();
  DotNetTypeRef secondTypeRef=resolve.getSecond();
  PsiElement elementToHighlight=resolve.getThird();
  CSharpTypeUtil.InheritResult inheritResult=CSharpTypeUtil.isInheritable(firstTypeRef,secondTypeRef,element,CSharpStaticTypeRef.IMPLICIT);
  if (!inheritResult.isSuccess()) {
    CompilerCheckBuilder builder=newBuilder(elementToHighlight,CSharpTypeRefPresentationUtil.buildTextWithKeyword(secondTypeRef,element),CSharpTypeRefPresentationUtil.buildTextWithKeyword(firstTypeRef,element));
    if (elementToHighlight instanceof DotNetExpression) {
      builder.addQuickFix(new CastExpressionToTypeRef((DotNetExpression)elementToHighlight,firstTypeRef));
    }
    if (element instanceof DotNetVariable) {
      builder.addQuickFix(new ChangeVariableToTypeRefFix((DotNetVariable)element,secondTypeRef));
    }
    if (element instanceof CSharpReturnStatementImpl) {
      CSharpSimpleLikeMethodAsElement methodElement=PsiTreeUtil.getParentOfType(element,CSharpSimpleLikeMethodAsElement.class);
      if (methodElement instanceof CSharpConversionMethodDeclaration || methodElement instanceof CSharpMethodDeclaration) {
        builder.addQuickFix(new ChangeReturnToTypeRefFix((DotNetLikeMethodDeclaration)methodElement,secondTypeRef));
      }
    }
    return builder;
  }
 else   if (inheritResult.isConversion()) {
    String text=CSharpErrorBundle.message("String_Node_Str",CSharpTypeRefPresentationUtil.buildTextWithKeyword(secondTypeRef,element),CSharpTypeRefPresentationUtil.buildTextWithKeyword(firstTypeRef,element));
    return newBuilder(elementToHighlight).setText(text).setHighlightInfoType(HighlightInfoType.INFORMATION).setTextAttributesKey(CSharpHighlightKey.IMPLICIT_OR_EXPLICIT_CAST);
  }
  return null;
}

Fixed version (ground truth):
@RequiredReadAction @Nullable @Override public CompilerCheckBuilder checkImpl(@NotNull CSharpLanguageVersion languageVersion,@NotNull PsiElement element){
  Trinity<? extends DotNetTypeRef,? extends DotNetTypeRef,? extends PsiElement> resolve=resolve(element);
  if (resolve == null) {
    return null;
  }
  DotNetTypeRef firstTypeRef=resolve.getFirst();
  DotNetTypeRef secondTypeRef=resolve.getSecond();
  if (firstTypeRef == DotNetTypeRef.ERROR_TYPE || secondTypeRef == DotNetTypeRef.ERROR_TYPE) {
    return null;
  }
  PsiElement elementToHighlight=resolve.getThird();
  CSharpTypeUtil.InheritResult inheritResult=CSharpTypeUtil.isInheritable(firstTypeRef,secondTypeRef,element,CSharpStaticTypeRef.IMPLICIT);
  if (!inheritResult.isSuccess()) {
    CompilerCheckBuilder builder=newBuilder(elementToHighlight,CSharpTypeRefPresentationUtil.buildTextWithKeyword(secondTypeRef,element),CSharpTypeRefPresentationUtil.buildTextWithKeyword(firstTypeRef,element));
    if (elementToHighlight instanceof DotNetExpression) {
      builder.addQuickFix(new CastExpressionToTypeRef((DotNetExpression)elementToHighlight,firstTypeRef));
    }
    if (element instanceof DotNetVariable) {
      builder.addQuickFix(new ChangeVariableToTypeRefFix((DotNetVariable)element,secondTypeRef));
    }
    if (element instanceof CSharpReturnStatementImpl) {
      CSharpSimpleLikeMethodAsElement methodElement=PsiTreeUtil.getParentOfType(element,CSharpSimpleLikeMethodAsElement.class);
      if (methodElement instanceof CSharpConversionMethodDeclaration || methodElement instanceof CSharpMethodDeclaration) {
        builder.addQuickFix(new ChangeReturnToTypeRefFix((DotNetLikeMethodDeclaration)methodElement,secondTypeRef));
      }
    }
    return builder;
  }
 else   if (inheritResult.isConversion()) {
    String text=CSharpErrorBundle.message("String_Node_Str",CSharpTypeRefPresentationUtil.buildTextWithKeyword(secondTypeRef,element),CSharpTypeRefPresentationUtil.buildTextWithKeyword(firstTypeRef,element));
    return newBuilder(elementToHighlight).setText(text).setHighlightInfoType(HighlightInfoType.INFORMATION).setTextAttributesKey(CSharpHighlightKey.IMPLICIT_OR_EXPLICIT_CAST);
  }
  return null;
}