diff --git a/base/docs.jl b/base/docs.jl index 678dd2ee1260b..f30c1f8932d71 100644 --- a/base/docs.jl +++ b/base/docs.jl @@ -150,7 +150,7 @@ end uncurly(ex) = isexpr(ex, :curly) ? ex.args[1] : ex -namify(ex::Expr) = namify(ex.args[1]) +namify(ex::Expr) = isexpr(ex, :.)? ex : namify(ex.args[1]) namify(sy::Symbol) = sy function mdify(ex) diff --git a/test/docs.jl b/test/docs.jl index ac5e7825c0b0f..80033efce882d 100644 --- a/test/docs.jl +++ b/test/docs.jl @@ -8,3 +8,15 @@ macro macro_doctest() end @doc "Helps test if macros can be documented with `@doc \"...\" -> @...`." -> @macro_doctest @test (@doc @macro_doctest) != nothing + +# issue #11548 + +module ModuleMacroDoc +macro m() end +end + +@doc ("I am a module";) ModuleMacroDoc +@doc ("I am a macro";) ModuleMacroDoc.@m + +@test (@doc ModuleMacroDoc) == "I am a module" +@test (@doc ModuleMacroDoc.@m) == "I am a macro"