Skip to content

Commit 6cc6441

Browse files
vtjnashtopolarity
authored andcommitted
doc: workaround for lowering scope mistake (#60002)
Co-authored-by: Cody Tapscott <[email protected]> (cherry picked from commit d5fb6bb)
1 parent f1e0d1c commit 6cc6441

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

base/docs/Docs.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,10 @@ function objectdoc(__source__, __module__, str, def, expr, sig = :(Union{}))
406406
# Special case: `global x` should return nothing to avoid syntax errors with assigning to a value
407407
val = nothing
408408
else
409+
if isexpr(def, :(=), 2) && isexpr(def.args[1], :curly)
410+
# workaround for lowering bug #60001
411+
exdef = Expr(:block, exdef)
412+
end
409413
val = :val
410414
exdef = Expr(:(=), val, exdef)
411415
end

test/docs.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,3 +1659,12 @@ module DocReturnValue
16591659
end
16601660
@test result11 isa Base.Docs.Binding
16611661
end
1662+
1663+
# https://github.com/JuliaLang/julia/issues/59949
1664+
struct Foo59949{T} end
1665+
1666+
"""
1667+
Bar59949{T}
1668+
"""
1669+
Bar59949{T} = Foo59949{T}
1670+
@test docstrings_equal(@doc(Bar59949), doc"Bar59949{T}")

0 commit comments

Comments
 (0)