Skip to content

Commit

Permalink
fix #7401
Browse files Browse the repository at this point in the history
  • Loading branch information
dsyme committed Apr 4, 2022
1 parent 6f1a778 commit efd6e9f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/fsharp/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9346,10 +9346,13 @@ and GetNewInferenceTypeForMethodArg cenv env tpenv x =
mkByrefTyWithInference g (GetNewInferenceTypeForMethodArg cenv env tpenv a) (NewByRefKindInferenceType g m)
| SynExpr.Lambda (body = 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)
| _ -> NewInferenceType g
| _ ->
NewInferenceType g

/// Method calls, property lookups, attribute constructions etc. get checked through here
and TcMethodApplication
Expand Down
16 changes: 16 additions & 0 deletions tests/fsharp/core/members/basics-hw/test.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -5656,6 +5656,22 @@ module Fix11816 =
check "wwvwev" a 64L
check "wwvwev23" b.X 64L

module OverloadResolutionUsingFunction =

open System
let ae = new AggregateException()

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

ae.Handle(function
| :? OperationCanceledException -> true
| _ -> false
)

#if TESTS_AS_APP
let RUN() = !failures
#else
Expand Down

0 comments on commit efd6e9f

Please sign in to comment.