diff --git a/src/Fantomas.Core.Tests/TypeDeclarationTests.fs b/src/Fantomas.Core.Tests/TypeDeclarationTests.fs index 7d20e3746f..42bb670189 100644 --- a/src/Fantomas.Core.Tests/TypeDeclarationTests.fs +++ b/src/Fantomas.Core.Tests/TypeDeclarationTests.fs @@ -3368,3 +3368,44 @@ module Primitives = #endif BlockHeightOffset16 = BlockHeightOffset16 of uint16 """ + +[] +let ``xml doc before recursive type, 2360`` () = + formatSourceString + false + """ +module Primitives = + type BlockHeight = + | BlockHeight of uint32 + + /// **Description** + /// + /// 16bit relative block height used for `OP_CSV` locks, + /// Since OP_CSV allow only block number of 0 ~ 65535, it is safe + /// to restrict into the range smaller than BlockHeight + and +#if !NoDUsAsStructs + [] +#endif + BlockHeightOffset16 = + | BlockHeightOffset16 of uint16 +""" + config + |> prepend newline + |> should + equal + """ +module Primitives = + type BlockHeight = BlockHeight of uint32 + + /// **Description** + /// + /// 16bit relative block height used for `OP_CSV` locks, + /// Since OP_CSV allow only block number of 0 ~ 65535, it is safe + /// to restrict into the range smaller than BlockHeight + and +#if !NoDUsAsStructs + [] +#endif + BlockHeightOffset16 = BlockHeightOffset16 of uint16 +"""