Skip to content

Commit 0e5b954

Browse files
authored
Sink: report function domain type (#17470)
* Sink: report function domain type * Release notes
1 parent 8a796ac commit 0e5b954

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

docs/release-notes/.FSharp.Compiler.Service/9.0.100.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
### Added
1010

1111
* Support for nullable reference types ([PR #15181](https://github.com/dotnet/fsharp/pull/15181))
12+
* Sink: report function domain type ([PR #17470](https://github.com/dotnet/fsharp/pull/17470))
1213

1314
### Changed
1415

src/Compiler/Checking/Expressions/CheckExpressions.fs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5755,8 +5755,8 @@ and TcExprUndelayed (cenv: cenv) (overallTy: OverallTy) env tpenv (synExpr: SynE
57555755
| SynExpr.Match (spMatch, synInputExpr, synClauses, _m, _trivia) ->
57565756
TcExprMatch cenv overallTy env tpenv synInputExpr spMatch synClauses
57575757

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)
57605760

57615761
| SynExpr.Assert (x, m) ->
57625762
TcNonControlFlowExpr env <| fun env ->
@@ -6009,12 +6009,13 @@ and TcExprMatch (cenv: cenv) overallTy env tpenv synInputExpr spMatch synClauses
60096009
// <@ function x -> (x: int) @>
60106010
// is
60116011
// 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) =
60136013
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)
60156016
let envinner = ExitFamilyRegion env
60166017
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
60186019
let overallExpr = mkMultiLambda m [idv1] ((mkLet spMatch m idv2 idve1 matchExpr), resultTy)
60196020
overallExpr, tpenv
60206021

0 commit comments

Comments
 (0)