diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index 35acc10eec6fb1..bfd3c8fface0da 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -904,7 +904,7 @@ x)) fields))) (attrs (reverse attrs)) - (defs (filter (lambda (x) (not (effect-free? x))) defs)) + (defs (filter (lambda (x) (not (or (effect-free? x) (eq? (car x) 'string)))) defs)) (locs (if (and (pair? fields0) (linenum? (car fields0))) (list (car fields0)) '())) diff --git a/test/docs.jl b/test/docs.jl index 41c3746d7476f3..762a481ee4801d 100644 --- a/test/docs.jl +++ b/test/docs.jl @@ -1504,3 +1504,12 @@ end # Issue #13109 eval(Expr(:block, Expr(:macrocall, GlobalRef(Core, Symbol("@doc")), nothing, "...", Expr(:module, false, :MBareModuleEmpty, Expr(:block))))) @test docstrings_equal(@doc(MBareModuleEmpty), doc"...") + +# issue #41727 +"struct docstring" +struct S41727 + "x is $(2*2)" + x +end +@test S41727(1) isa S41727 +@test string(@repl S41727.x) == "x is 4\n"