diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index dab7a9efdfc..8c5ed2c88ae 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -2387,7 +2387,9 @@ module InferredSigPrinting = let nmL = layoutAccessibility denv mspec.Accessibility nmL let denv = denv.AddAccessibility mspec.Accessibility let basic = imdefL denv def - let modNameL = wordL (tagKeyword "module") ^^ nmL + let modNameL = + wordL (tagKeyword "module") ^^ nmL + |> layoutAttribs denv None false mspec.TypeOrMeasureKind mspec.Attribs let modNameEqualsL = modNameL ^^ WordL.equals let isNamespace = function | Namespace _ -> true | _ -> false let modIsOuter = (outerPath |> List.forall (fun (_, istype) -> isNamespace istype) ) diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs index b01f99c4bf4..0e2f838cf0b 100644 --- a/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs @@ -197,3 +197,25 @@ do () """ |> printSignatures |> should equal "namespace Foobar" + +[] +let ``Attribute on nested module`` () = + FSharp + """ +namespace MyApp.Types + +[] +[] +module Area = + type Meh = class end +""" + |> printSignatures + |> prependNewline + |> should equal """ +namespace MyApp.Types + + [ (4))>] + module Area = + + type Meh = + class end"""