Skip to content

Commit 43932b4

Browse files
authored
Remove LetOrUseKeyword from SynExprLetOrUseTrivia (#19090)
1 parent 3c6f45e commit 43932b4

File tree

352 files changed

+4941
-4174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

352 files changed

+4941
-4174
lines changed
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
### Fixed
22

3-
* Type relations cache: optimize key generation ([Issue #19116](https://github.com/dotnet/fsharp/issues/18767)) ([PR #19120](https://github.com/dotnet/fsharp/pull/19120))
3+
* Type relations cache: optimize key generation ([Issue #19116](https://github.com/dotnet/fsharp/issues/18767)) ([PR #19120](https://github.com/dotnet/fsharp/pull/19120))
4+
5+
### Breaking Changes
6+
7+
* `SynExpr.LetOrUse` holds `SynLetOrUse`. ([PR #19090](https://github.com/dotnet/fsharp/pull/19090))
8+
* `SynExprLetOrUseTrivia` is now `SynLetOrUseTrivia`. ([PR #19090](https://github.com/dotnet/fsharp/pull/19090))
9+
* `SynMemberDefn.LetBindings` has trivia. ([PR #19090](https://github.com/dotnet/fsharp/pull/19090))
10+
* `SynModuleDecl.Let` has trivia. ([PR #19090](https://github.com/dotnet/fsharp/pull/19090))

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,3 @@
2525

2626
* Parallel compilation features: ref resolution, graph based checking, ILXGen and optimization enabled by default ([PR #18998](https://github.com/dotnet/fsharp/pull/18998))
2727
* Make graph based type checking and parallel optimizations deterministic ([PR #19028](https://github.com/dotnet/fsharp/pull/19028))
28-
29-
30-
### Breaking Changes

src/Compiler/Checking/CheckDeclarations.fs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ module MutRecBindingChecking =
11081108
let innerState = (incrCtorInfoOpt, envForTycon, tpenv, recBindIdx, uncheckedBindsRev)
11091109
[Phase2AInherit (ty, arg, baseValOpt, m); Phase2AIncrClassCtorJustAfterSuperInit], innerState
11101110

1111-
| Some (SynMemberDefn.LetBindings (letBinds, isStatic, isRec, m)), _ ->
1111+
| Some (SynMemberDefn.LetBindings (bindings = letBinds; isStatic = isStatic; isRecursive = isRec; range = m)), _ ->
11121112
match tcref.TypeOrMeasureKind, isStatic with
11131113
| TyparKind.Measure, false -> errorR(Error(FSComp.SR.tcMeasureDeclarationsRequireStaticMembers(), m))
11141114
| _ -> ()
@@ -4412,7 +4412,7 @@ module TcDeclarations =
44124412
let attribs = mkAttributeList attribs mWholeAutoProp
44134413
let binding = mkSynBinding (xmlDoc, headPat) (None, false, isMutable, mLetPortion, DebugPointAtBinding.NoneAtInvisible, retInfo, synExpr, synExpr.Range, [], attribs, None, SynBindingTrivia.Zero)
44144414

4415-
[(SynMemberDefn.LetBindings ([binding], isStatic, false, mWholeAutoProp))]
4415+
[(SynMemberDefn.LetBindings ([binding], isStatic, false, mWholeAutoProp, SynMemberDefnLetBindingsTrivia.Zero))]
44164416

44174417
| SynMemberDefn.Interface (members=Some membs) -> membs |> List.collect preAutoProps
44184418
| SynMemberDefn.LetBindings _
@@ -5113,7 +5113,7 @@ let ElimSynModuleDeclExpr bind =
51135113
match bind with
51145114
| SynModuleDecl.Expr (expr, m) ->
51155115
let bind2 = SynBinding (None, SynBindingKind.StandaloneExpression, false, false, [], PreXmlDoc.Empty, SynInfo.emptySynValData, SynPat.Wild m, None, expr, m, DebugPointAtBinding.NoneAtDo, SynBindingTrivia.Zero)
5116-
SynModuleDecl.Let(false, [bind2], m)
5116+
SynModuleDecl.Let(false, [bind2], m, SynModuleDeclLetTrivia.Zero)
51175117
| _ -> bind
51185118

51195119
let TcMutRecDefnsEscapeCheck (binds: MutRecShapes<_, _, _>) env =
@@ -5187,12 +5187,12 @@ let TcModuleOrNamespaceElementsMutRec (cenv: cenv) parent typeNames m envInitial
51875187
let decls = typeDefs |> List.map MutRecShape.Tycon
51885188
decls, (false, false, attrs)
51895189

5190-
| SynModuleDecl.Let (letrec, binds, m) ->
5190+
| SynModuleDecl.Let (isRecursive = isRecursive; bindings = binds; range = m) ->
51915191
let binds =
51925192
if isNamespace then
51935193
CheckLetOrDoInNamespace binds m; []
51945194
else
5195-
if letrec then [MutRecShape.Lets binds]
5195+
if isRecursive then [MutRecShape.Lets binds]
51965196
else List.map (List.singleton >> MutRecShape.Lets) binds
51975197
binds, (false, false, attrs)
51985198

@@ -5292,7 +5292,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem
52925292
| _ -> [ TMDefOpens openDecls ]
52935293
return (defns, [], []), env, env
52945294

5295-
| SynModuleDecl.Let (letrec, binds, m) ->
5295+
| SynModuleDecl.Let (isRecursive = isRecursive; bindings = binds; range = m) ->
52965296

52975297
match parent with
52985298
| ParentNone ->
@@ -5301,7 +5301,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem
53015301

53025302
| Parent parentModule ->
53035303
let containerInfo = ModuleOrNamespaceContainerInfo parentModule
5304-
if letrec then
5304+
if isRecursive then
53055305
let scopem = unionRanges m scopem
53065306
let binds = binds |> List.map (fun bind -> RecDefnBindingInfo(containerInfo, NoNewSlots, ModuleOrMemberBinding, bind))
53075307
let binds, env, _ = TcLetrecBindings WarnOnOverrides cenv env tpenv (binds, m, scopem)

src/Compiler/Checking/CheckRecordSyntaxHelpers.fs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,14 @@ let BindOriginalRecdExpr (withExpr: SynExpr * BlockSeparator) mkRecdExpr =
193193
None,
194194
SynBindingTrivia.Zero)
195195

196-
SynExpr.LetOrUse(
197-
isRecursive = false,
198-
isUse = false,
199-
isFromSource = false, // compiler generated during desugaring
200-
isBang = false,
201-
bindings = [ binding ],
202-
body = mkRecdExpr (Some withExpr),
203-
range = mOrigExprSynth,
204-
trivia = SynExprLetOrUseTrivia.Zero
205-
)
196+
SynExpr.LetOrUse
197+
{
198+
IsRecursive = false
199+
//isUse = false,
200+
IsFromSource = false // compiler generated during desugaring
201+
// isBang = false,
202+
Bindings = [ binding ]
203+
Body = mkRecdExpr (Some withExpr)
204+
Range = mOrigExprSynth
205+
Trivia = SynLetOrUseTrivia.Zero
206+
}

0 commit comments

Comments
 (0)