diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index c2b8f6cc420..520d309293c 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -290,21 +290,8 @@ let rec AdjustRequiredTypeForTypeDirectedConversions (infoReader: InfoReader) ad g.int32_ty, TypeDirectedConversionUsed.Yes(warn TypeDirectedConversion.BuiltIn), None elif g.langVersion.SupportsFeature LanguageFeature.NullableOptionalInterop && isMethodArg && isNullableTy g reqdTy && not (isNullableTy g actualTy) then - let reqdTy2 = - if isTyparTy g reqdTy then - let tp = destTyparTy g reqdTy - match tp.Constraints |> List.choose (function TyparConstraint.CoercesTo (c, _) -> Some c | _ -> None) with - | [reqdTy2] when tp.Rigidity = TyparRigidity.Flexible -> reqdTy2 - | _ -> reqdTy - else reqdTy - - if not (isTyparTy g reqdTy2) && - (not (TypeFeasiblySubsumesType 0 g infoReader.amap m reqdTy2 CanCoerce actualTy) || - isTyparTy g actualTy && (let ftyvs = freeInType CollectAll reqdTy2 in ftyvs.FreeTypars.Contains(destTyparTy g actualTy))) then + actualTy, TypeDirectedConversionUsed.Yes(warn TypeDirectedConversion.BuiltIn), None - actualTy, TypeDirectedConversionUsed.Yes(warn TypeDirectedConversion.BuiltIn), Some (reqdTy, reqdTy2, ignore) - else - reqdTy, TypeDirectedConversionUsed.No, None // Adhoc based on op_Implicit, perhaps returing a new equational type constraint to // eliminate articifical constrained type variables. elif g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions then