Skip to content

Commit 28d8f98

Browse files
committed
escape defexprs
1 parent 93fdd2c commit 28d8f98

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

base/util.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ function _kwdef!(blk, params_args, call_args)
716716
continue
717717
end
718718
defexpr = ei.args[2] # defexpr
719-
push!(params_args, Expr(:kw, var, defexpr))
719+
push!(params_args, Expr(:kw, var, esc(defexpr)))
720720
push!(call_args, var)
721721
blk.args[i] = lhs
722722
elseif ei.head == :(::) && ei.args[1] isa Symbol

test/misc.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,16 +708,13 @@ end
708708
@test_throws AssertionError TestInnerConstructor(a="")
709709
end
710710

711-
712711
const outsidevar = 7
713712
@kwdef struct TestOutsideVar
714713
a::Int=outsidevar
715714
end
716715
@test TestOutsideVar() == TestOutsideVar(7)
717716

718717

719-
720-
721718
@testset "exports of modules" begin
722719
for (_, mod) in Base.loaded_modules
723720
for v in names(mod)

0 commit comments

Comments
 (0)