Skip to content

Commit 71cfac2

Browse files
authored
Merge branch 'main' into remove-option
2 parents 8f5fc7c + 6cdcc3c commit 71cfac2

File tree

82 files changed

+2294
-3246
lines changed

Some content is hidden

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

82 files changed

+2294
-3246
lines changed

TESTGUIDE.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,6 @@ Tags are in the left column, paths to to corresponding test folders are in the r
151151

152152
If you want to re-run a particular test area, the easiest way to do so is to set a temporary tag for that area in test.lst (e.g. "RERUN") and adjust `ttags` [run.fsharpqa.test.fsx script](tests/fsharpqa/run.fsharpqa.test.fsx) and run it.
153153

154-
### VisualFSharp.UnitTests
155-
156-
These are currently NUnit tests (we hope to migrate them to xUnit). You can execute these tests individually via the Visual Studio NUnit3 runner
157-
extension or the command line via `nunit3-console.exe`.
158-
159-
Note that for compatibility reasons, the IDE unit tests should be run in a 32-bit process,
160-
using the `--x86` flag to `nunit3-console.exe`
161-
162154
### Logs and output
163155

164156
All test execution logs and result files will be dropped into the `tests\TestResults` folder, and have file names matching

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
* Make ILTypeDef interface impls calculation lazy. ([PR #17392](https://github.com/dotnet/fsharp/pull/17392))
1010
* Remove non-functional useSyntaxTreeCache option. ([PR #17768](https://github.com/dotnet/fsharp/pull/17768))
1111
* Better ranges for CE `let!` and `use!` error reporting. ([PR #17712](https://github.com/dotnet/fsharp/pull/17712))
12+
* Better ranges for CE `do!` error reporting. ([PR #17779](https://github.com/dotnet/fsharp/pull/17779))
1213

1314
### Breaking Changes

src/Compiler/Checking/Expressions/CheckComputationExpressions.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,7 @@ let rec TryTranslateComputationExpression
15921592
if ceenv.isQuery && not (innerComp1.IsArbExprAndThusAlreadyReportedError) then
15931593
match innerComp1 with
15941594
| SynExpr.JoinIn _ -> ()
1595-
| SynExpr.DoBang(range = m) -> errorR (Error(FSComp.SR.tcBindMayNotBeUsedInQueries (), m))
1595+
| SynExpr.DoBang(trivia = { DoBangKeyword = m }) -> errorR (Error(FSComp.SR.tcBindMayNotBeUsedInQueries (), m))
15961596
| _ -> errorR (Error(FSComp.SR.tcUnrecognizedQueryOperator (), innerComp1.RangeOfFirstPortion))
15971597

15981598
match
@@ -1657,7 +1657,7 @@ let rec TryTranslateComputationExpression
16571657
| None ->
16581658
// "do! expr; cexpr" is treated as { let! () = expr in cexpr }
16591659
match innerComp1 with
1660-
| SynExpr.DoBang(rhsExpr, m) ->
1660+
| SynExpr.DoBang(expr = rhsExpr; range = m) ->
16611661
let sp =
16621662
match sp with
16631663
| DebugPointAtSequential.SuppressExpr -> DebugPointAtBinding.NoneAtDo
@@ -2867,7 +2867,7 @@ and TranslateComputationExpression (ceenv: ComputationExpressionContext<'a>) fir
28672867
// This only occurs in final position in a sequence
28682868
match comp with
28692869
// "do! expr;" in final position is treated as { let! () = expr in return () } when Return is provided (and no Zero with Default attribute is available) or as { let! () = expr in zero } otherwise
2870-
| SynExpr.DoBang(rhsExpr, m) ->
2870+
| SynExpr.DoBang(expr = rhsExpr; trivia = { DoBangKeyword = m }) ->
28712871
let mUnit = rhsExpr.Range
28722872
let rhsExpr = mkSourceExpr rhsExpr ceenv.sourceMethInfo ceenv.builderValName
28732873

src/Compiler/Checking/Expressions/CheckExpressions.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6003,10 +6003,10 @@ and TcExprUndelayed (cenv: cenv) (overallTy: OverallTy) env tpenv (synExpr: SynE
60036003
| SynExpr.ImplicitZero m ->
60046004
error(Error(FSComp.SR.tcConstructRequiresSequenceOrComputations(), m))
60056005

6006-
| SynExpr.DoBang (_, m)
6006+
| SynExpr.DoBang (trivia = { DoBangKeyword = m })
60076007
| SynExpr.MatchBang (range = m)
60086008
| SynExpr.WhileBang (range = m)
6009-
| SynExpr.LetOrUseBang (range = m) ->
6009+
| SynExpr.LetOrUseBang (trivia = { LetOrUseBangKeyword = m }) ->
60106010
error(Error(FSComp.SR.tcConstructRequiresComputationExpression(), m))
60116011

60126012
| SynExpr.IndexFromEnd (rightExpr, m) ->

src/Compiler/Checking/Expressions/CheckSequenceExpressions.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ let TcSequenceExpression (cenv: TcFileState) env tpenv comp (overallTy: OverallT
168168

169169
| SynExpr.ImplicitZero m -> Some(mkSeqEmpty cenv env m genOuterTy, tpenv)
170170

171-
| SynExpr.DoBang(_rhsExpr, m) -> error (Error(FSComp.SR.tcDoBangIllegalInSequenceExpression (), m))
171+
| SynExpr.DoBang(trivia = { DoBangKeyword = m }) -> error (Error(FSComp.SR.tcDoBangIllegalInSequenceExpression (), m))
172172

173173
| SynExpr.Sequential(sp, true, innerComp1, innerComp2, m, _) ->
174174
let env1 =

src/Compiler/Driver/GraphChecking/FileContentMapping.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ let visitSynExpr (e: SynExpr) : FileContentEntry list =
523523
visit expr (fun exprNodes ->
524524
[ yield! exprNodes; yield! List.collect visitSynMatchClause clauses ]
525525
|> continuation)
526-
| SynExpr.DoBang(expr, _) -> visit expr continuation
526+
| SynExpr.DoBang(expr = expr) -> visit expr continuation
527527
| SynExpr.WhileBang(whileExpr = whileExpr; doExpr = doExpr) ->
528528
visit whileExpr (fun whileNodes -> visit doExpr (fun doNodes -> whileNodes @ doNodes |> continuation))
529529
| SynExpr.LibraryOnlyILAssembly(typeArgs = typeArgs; args = args; retTy = retTy) ->

src/Compiler/Service/FSharpParseFileResults.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput,
578578
yield! walkExpr false e
579579

580580
| SynExpr.YieldOrReturnFrom(_, e, _)
581-
| SynExpr.DoBang(e, _) ->
581+
| SynExpr.DoBang(expr = e) ->
582582
yield! checkRange e.Range
583583
yield! walkExpr false e
584584

src/Compiler/Service/ServiceInterfaceStubGenerator.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -952,9 +952,9 @@ module InterfaceStubGenerator =
952952
| SynExpr.Null _range
953953
| SynExpr.ImplicitZero _range -> None
954954

955-
| SynExpr.YieldOrReturn(_, synExpr, _range)
956-
| SynExpr.YieldOrReturnFrom(_, synExpr, _range)
957-
| SynExpr.DoBang(synExpr, _range) -> walkExpr synExpr
955+
| SynExpr.YieldOrReturn(expr = synExpr)
956+
| SynExpr.YieldOrReturnFrom(expr = synExpr)
957+
| SynExpr.DoBang(expr = synExpr) -> walkExpr synExpr
958958

959959
| SynExpr.LetOrUseBang(rhs = synExpr1; andBangs = synExprAndBangs; body = synExpr2) ->
960960
[

src/Compiler/Service/ServiceStructure.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ module Structure =
254254
rcheck Scope.YieldOrReturnBang Collapse.Below r r
255255
parseExpr e
256256

257-
| SynExpr.DoBang(e, r) ->
257+
| SynExpr.DoBang(expr = e; range = r) ->
258258
rcheck Scope.Do Collapse.Below r <| Range.modStart 3 r
259259
parseExpr e
260260

src/Compiler/SyntaxTree/SyntaxTree.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ type SynExpr =
726726
range: range *
727727
trivia: SynExprMatchBangTrivia
728728

729-
| DoBang of expr: SynExpr * range: range
729+
| DoBang of expr: SynExpr * range: range * trivia: SynExprDoBangTrivia
730730

731731
| WhileBang of whileDebugPoint: DebugPointAtWhile * whileExpr: SynExpr * doExpr: SynExpr * range: range
732732

0 commit comments

Comments
 (0)