From b67698f3912d9ec96fc87ee17e280e6a6092cec1 Mon Sep 17 00:00:00 2001 From: nojaf Date: Thu, 26 Feb 2026 09:16:57 +0100 Subject: [PATCH] Add regression test for long delegate --- CHANGELOG.md | 1 + src/Fantomas.Core.Tests/TypeDeclarationTests.fs | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9055a1a5e..09c0c865d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Trivia around paren lambda with conditional compilation no longer causes merge error. [#2844](https://github.com/fsprojects/fantomas/issues/2844) - Type app closing angle bracket padded by previous expression length. [#3179](https://github.com/fsprojects/fantomas/issues/3179) - Dynamic operator on result of qualified function call causes formatting error. [#3135](https://github.com/fsprojects/fantomas/issues/3135) +- Long delegate type with generic args no longer breaks around arrow. [#2468](https://github.com/fsprojects/fantomas/issues/2468) ## [8.0.0-alpha-002] - 2025-12-15 diff --git a/src/Fantomas.Core.Tests/TypeDeclarationTests.fs b/src/Fantomas.Core.Tests/TypeDeclarationTests.fs index 9ba7b1b75a..92943e771f 100644 --- a/src/Fantomas.Core.Tests/TypeDeclarationTests.fs +++ b/src/Fantomas.Core.Tests/TypeDeclarationTests.fs @@ -723,6 +723,21 @@ type SomeWin32Callback = bool """ +[] +let ``long delegate with generic args should not break around arrow, 2468`` () = + formatSourceString + """ +type some_delegate = delegate of Func * Guid * string * Func, int> -> Func, string, string> +""" + config + |> prepend newline + |> should + equal + """ +type some_delegate = + delegate of Func * Guid * string * Func, int> -> Func, string, string> +""" + [] let ``should keep the ? in optional parameters`` () = formatSourceString