@@ -5755,8 +5755,8 @@ and TcExprUndelayed (cenv: cenv) (overallTy: OverallTy) env tpenv (synExpr: SynE
5755
5755
| SynExpr.Match (spMatch, synInputExpr, synClauses, _m, _trivia) ->
5756
5756
TcExprMatch cenv overallTy env tpenv synInputExpr spMatch synClauses
5757
5757
5758
- | SynExpr.MatchLambda (isExnMatch, mArg , clauses, spMatch, m) ->
5759
- TcExprMatchLambda cenv overallTy env tpenv (isExnMatch, mArg , clauses, spMatch, m)
5758
+ | SynExpr.MatchLambda (isExnMatch, mFunction , clauses, spMatch, m) ->
5759
+ TcExprMatchLambda cenv overallTy env tpenv (isExnMatch, mFunction , clauses, spMatch, m)
5760
5760
5761
5761
| SynExpr.Assert (x, m) ->
5762
5762
TcNonControlFlowExpr env <| fun env ->
@@ -6009,12 +6009,13 @@ and TcExprMatch (cenv: cenv) overallTy env tpenv synInputExpr spMatch synClauses
6009
6009
// <@ function x -> (x: int) @>
6010
6010
// is
6011
6011
// Lambda (_arg2, Let (x, _arg2, x))
6012
- and TcExprMatchLambda (cenv: cenv) overallTy env tpenv (isExnMatch, mArg , clauses, spMatch, m) =
6012
+ and TcExprMatchLambda (cenv: cenv) overallTy env tpenv (isExnMatch, mFunction , clauses, spMatch, m) =
6013
6013
let domainTy, resultTy = UnifyFunctionType None cenv env.DisplayEnv m overallTy.Commit
6014
- let idv1, idve1 = mkCompGenLocal mArg (cenv.synArgNameGenerator.New()) domainTy
6014
+ let idv1, idve1 = mkCompGenLocal mFunction (cenv.synArgNameGenerator.New()) domainTy
6015
+ CallExprHasTypeSink cenv.tcSink (mFunction.StartRange, env.NameEnv, domainTy, env.AccessRights)
6015
6016
let envinner = ExitFamilyRegion env
6016
6017
let envinner = { envinner with eIsControlFlow = true }
6017
- let idv2, matchExpr, tpenv = TcAndPatternCompileMatchClauses m mArg (if isExnMatch then Throw else ThrowIncompleteMatchException) cenv None domainTy (MustConvertTo (false, resultTy)) envinner tpenv clauses
6018
+ let idv2, matchExpr, tpenv = TcAndPatternCompileMatchClauses m mFunction (if isExnMatch then Throw else ThrowIncompleteMatchException) cenv None domainTy (MustConvertTo (false, resultTy)) envinner tpenv clauses
6018
6019
let overallExpr = mkMultiLambda m [idv1] ((mkLet spMatch m idv2 idve1 matchExpr), resultTy)
6019
6020
overallExpr, tpenv
6020
6021
0 commit comments