diff --git a/base/docs/core.jl b/base/docs/core.jl index b193483840801..af784f2574200 100644 --- a/base/docs/core.jl +++ b/base/docs/core.jl @@ -17,7 +17,7 @@ lazy_iterpolate(s::AbstractString) = Expr(:call, Core.svec, s) lazy_iterpolate(@nospecialize x) = isexpr(x, :string) ? Expr(:call, Core.svec, x.args...) : x function docm(source::LineNumberNode, mod::Module, str, x) - out = Expr(:call, doc!, QuoteNode(source), mod, lazy_iterpolate(str), Expr(:quote, x)) + out = Expr(:call, doc!, QuoteNode(source), mod, lazy_iterpolate(str), QuoteNode(x)) if isexpr(x, :module) out = Expr(:toplevel, out, x) elseif isexpr(x, :call) diff --git a/test/docs.jl b/test/docs.jl index 5ee2e00aacdfd..3a925d65a4334 100644 --- a/test/docs.jl +++ b/test/docs.jl @@ -1120,3 +1120,21 @@ struct A_20087 end (a::A_20087)() = a @test docstrings_equal(@doc(A_20087()), doc"a") + +# issue #27832 + +_last_atdoc = Core.atdoc +Core.atdoc!(Core.Compiler.CoreDocs.docm) # test bootstrap doc system + +""" +""" +module M27832 +macro foo(x) + repr(x) +end +for fn in (:isdone,) + global xs = @foo $fn +end +end +@test M27832.xs == ":(\$(Expr(:\$, :fn)))" +Core.atdoc!(_last_atdoc)