fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.96k stars 286 forks source link

Stack traces: kwargs shown at wrong place #2770

Open fonsp opened 9 months ago

fonsp commented 9 months ago

The kwargs are showing up at the start, not the end...

image
julia> # ╔═╡ 79b51e48-ab15-11ee-3759-9d14aacd5478
       VERSION
v"1.9.3"

julia> # ╔═╡ 02688dc8-37d9-4043-b12f-3849abbd9b28
       f(g, a; kw...) = error();

julia> # ╔═╡ ec17c915-0198-49f8-ba5a-ec3d55555d6e
       f(1,2)
ERROR: 
Stacktrace:
 [1] error()
   @ Base ./error.jl:44
 [2] f(g::Int64, a::Int64; kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Main ./REPL[3]:2
 [3] f(g::Int64, a::Int64)
   @ Main ./REPL[3]:2
 [4] top-level scope
   @ REPL[4]:2
fonsp commented 9 months ago

Simpler example:

image
julia> g(x::Integer; y::String) = error()
g (generic function with 1 method)

julia> g(1; y="twee")
ERROR: 
Stacktrace:
 [1] error()
   @ Base ./error.jl:44
 [2] g(x::Int64; y::String)
   @ Main ./REPL[5]:2
 [3] top-level scope
   @ REPL[6]:2