diff --git a/src/Fantomas.Tests/SignatureTests.fs b/src/Fantomas.Tests/SignatureTests.fs index 8542310873..611d0efd47 100644 --- a/src/Fantomas.Tests/SignatureTests.fs +++ b/src/Fantomas.Tests/SignatureTests.fs @@ -1105,3 +1105,49 @@ module Teq = val domainOf<'domain1, 'domain2, 'range1, 'range2> : Teq<'domain1 -> 'range1, 'domain2 -> 'range2> -> Teq<'domain1, 'domain2> """ + +[] +let ``inline type definition member, 1399`` () = + formatSourceString + true + """ +namespace Baz + +[] +type Foo = + member inline Return : 'a -> Baz<'a> +""" + config + |> prepend newline + |> should + equal + """ +namespace Baz + +[] +type Foo = + member inline Return: 'a -> Baz<'a> +""" + +[] +let ``inline private type definition member`` () = + formatSourceString + true + """ +namespace Baz + +[] +type Foo = + member inline private Return : 'a -> Baz<'a> +""" + config + |> prepend newline + |> should + equal + """ +namespace Baz + +[] +type Foo = + member inline private Return: 'a -> Baz<'a> +""" diff --git a/src/Fantomas/CodePrinter.fs b/src/Fantomas/CodePrinter.fs index 653c5c20e1..b52ae8bb57 100644 --- a/src/Fantomas/CodePrinter.fs +++ b/src/Fantomas/CodePrinter.fs @@ -3714,7 +3714,7 @@ and genMemberSig astContext node = | SynMemberSig.NestedType (_, r) -> r, SynMemberSig_NestedType match node with - | MSMember (Val (ats, px, ao, s, t, vi, _, ValTyparDecls (tds, _, tcs)), mf) -> + | MSMember (Val (ats, px, ao, s, t, vi, isInline, ValTyparDecls (tds, _, tcs)), mf) -> let (FunType namedArgs) = (t, vi) let isFunctionProperty = @@ -3735,6 +3735,7 @@ and genMemberSig astContext node = InterfaceRange = None } mf range + +> ifElse isInline (!- "inline ") sepNone +> opt sepSpace ao genAccess +> ifElse (s = "``new``") (!- "new") (!-s) +> genTypeParamPostfix astContext tds tcs