Skip to content

Commit

Permalink
function implicit conversion the same way as fun x
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarfgp committed Aug 4, 2024
1 parent ed7905d commit 0b1e680
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Compiler/Checking/Expressions/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9685,6 +9685,8 @@ and GetNewInferenceTypeForMethodArg (cenv: cenv) env tpenv x =
| SynExpr.Lambda (body = a)
| SynExpr.DotLambda (expr = a) ->
mkFunTy g (NewInferenceType g) (GetNewInferenceTypeForMethodArg cenv env tpenv a)
| SynExpr.MatchLambda _ ->
mkFunTy g (NewInferenceType g) (NewInferenceType g)
| SynExpr.Quote (_, raw, a, _, _) ->
if raw then mkRawQuotedExprTy g
else mkQuotedExprTy g (GetNewInferenceTypeForMethodArg cenv env tpenv a)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
open System
let ae = new AggregateException()

ae.Handle(fun e ->
match e with
| :? OperationCanceledException -> true
| _ -> false
)

ae.Handle(function
| :? OperationCanceledException -> true
| _ -> false
)
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,9 @@ module MemberDefinitions_OverloadingMembers =
|> withDefines ["TOO_GENERIC"]
|> verifyCompileAndRun
|> shouldSucceed

[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"OverloadResolutionUsingFunction.fs"|])>]
let ``OverloadResolutionUsingFunction_fs`` compilation =
compilation
|> verifyCompileAndRun
|> shouldSucceed

0 comments on commit 0b1e680

Please sign in to comment.