It works in 0.4, tested with a slight adaption of @sglyon’s example:
f(;kwargs...) = Dict(kwargs)
let
v = rand(5)
global g # in 0.4 this syntax is needed
function g()
f(myvar=v)
end
end
@show g() # errors in 0.5 and 0.6 but not 0.4
This seems like a regression to me. If not a regression, it would need at least a better error message. Unless there is other feedback here, please file an issue.