Skip to content

Commit cf6a91a

Browse files
authored
Merge pull request fsprojects#3217 from nojaf/fix-2468
Add regression test for long delegate
2 parents 9bb0cd6 + b67698f commit cf6a91a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Trivia around paren lambda with conditional compilation no longer causes merge error. [#2844](https://github.com/fsprojects/fantomas/issues/2844)
1313
- Type app closing angle bracket padded by previous expression length. [#3179](https://github.com/fsprojects/fantomas/issues/3179)
1414
- Dynamic operator on result of qualified function call causes formatting error. [#3135](https://github.com/fsprojects/fantomas/issues/3135)
15+
- Long delegate type with generic args no longer breaks around arrow. [#2468](https://github.com/fsprojects/fantomas/issues/2468)
1516

1617
## [8.0.0-alpha-002] - 2025-12-15
1718

src/Fantomas.Core.Tests/TypeDeclarationTests.fs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,21 @@ type SomeWin32Callback =
723723
bool
724724
"""
725725

726+
[<Test>]
727+
let ``long delegate with generic args should not break around arrow, 2468`` () =
728+
formatSourceString
729+
"""
730+
type some_delegate = delegate of Func<int, int> * Guid * string * Func<Func<int, int>, int> -> Func<Func<int, int>, string, string>
731+
"""
732+
config
733+
|> prepend newline
734+
|> should
735+
equal
736+
"""
737+
type some_delegate =
738+
delegate of Func<int, int> * Guid * string * Func<Func<int, int>, int> -> Func<Func<int, int>, string, string>
739+
"""
740+
726741
[<Test>]
727742
let ``should keep the ? in optional parameters`` () =
728743
formatSourceString

0 commit comments

Comments
 (0)