Skip to content

Commit 6b1ce03

Browse files
authored
Merge pull request #3095 from dawedawe/fix_2865
Add a missing case to containsLambdaOrMatchExpr to fix 2865
2 parents 854d9b3 + 5fa884a commit 6b1ce03

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Changelog
22

3+
## 6.3.9 - 2024-06-10
4+
5+
### Fixed
6+
* Invalid location of comma when using named parameters for a class. [#2865](https://github.com/fsprojects/fantomas/issues/2865)
7+
38
## 6.3.8 - 2024-06-06
49

510
### Fixed
11+
* Fix loss of tuple type annotation without parens. [#2942](https://github.com/fsprojects/fantomas/issues/2942)
612
* Fix precedence change of `||>` due to inserted newline. [#2866](https://github.com/fsprojects/fantomas/issues/2866)
713

814
## 6.3.7 - 2024-06-01

Diff for: src/Fantomas.Core.Tests/ConstructorTests.fs

+35
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,38 @@ type CreateBuildingViewModel =
202202
203203
then vm.program <- p
204204
"""
205+
206+
[<Test>]
207+
let ``invalid location of comma when using named parameters for a class, 2865`` () =
208+
formatSourceString
209+
"""
210+
let instance =
211+
MyClass(
212+
Prop =
213+
match value.SomeValue with
214+
| Some _ -> 0.0m
215+
| None -> 0.0m
216+
,
217+
Prop2 =
218+
match value.SomeValue with
219+
| Some _ -> 0.0m
220+
| None -> 0.0m
221+
)
222+
"""
223+
config
224+
|> prepend newline
225+
|> should
226+
equal
227+
"""
228+
let instance =
229+
MyClass(
230+
Prop =
231+
match value.SomeValue with
232+
| Some _ -> 0.0m
233+
| None -> 0.0m
234+
, Prop2 =
235+
match value.SomeValue with
236+
| Some _ -> 0.0m
237+
| None -> 0.0m
238+
)
239+
"""

Diff for: src/Fantomas.Core/CodePrinter.fs

+1
Original file line numberDiff line numberDiff line change
@@ -1899,6 +1899,7 @@ let genTupleMultiline (node: ExprTupleNode) =
18991899
| Expr.Lambda _ -> true
19001900
| Expr.InfixApp node ->
19011901
match node.RightHandSide with
1902+
| Expr.Match _
19021903
| Expr.Lambda _ -> true
19031904
| _ -> false
19041905
| Expr.SameInfixApps node ->

0 commit comments

Comments
 (0)