mauro3/Parameters.jl

unpack screws up subsequent backtraces

marius311 opened this issue · 3 comments

@unpack seems to do something weird to backtraces for errors which appear after it. For example, why does Parameters.jl appear in the following backtrace at all?

julia> using Parameters

julia> function foo(nt)
           @unpack x,y = nt
           error("message")
       end
foo (generic function with 1 method)

julia> foo((x=1,y=2))
ERROR: message
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] macro expansion at /home/marius/.julia/packages/Parameters/rOe8Q/src/Parameters.jl:734 [inlined]
 [3] foo(::NamedTuple{(:x, :y),Tuple{Int64,Int64}}) at ./REPL[2]:2
 [4] top-level scope at none:0

I get other screwy behavior in my real code, but I figure this simple example can probably help track down the problem. I'm on Julia 1.0.2 and Parameters v0.10.2.

Thanks. Of note: this does not happen in Julia-0.6.

It's a v1.0 thing: JuliaLang/julia#28618 . Should be fixed in v1.1

Yes, that's it, it works fine on Julia-master. Thanks Chris!