Skip to content

Commit

Permalink
fix JuliaLang#41727, field doc string with interpolation (JuliaLang#4…
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored and LilithHafner committed Feb 22, 2022
1 parent 24a5f6f commit fa7ce18
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
'()))
Expand Down
9 changes: 9 additions & 0 deletions test/docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit fa7ce18

Please sign in to comment.