You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow up for once #1 is merged.
Adding keyword support.
It is just really fiddly.
The information is there but its not in a very easy to acess form:
julia>g(; x=1, y=3) = x+y
g (generic function with 2 methods)
julia>g(a; b=2) = a-b
g (generic function with 2 methods)
julia> meths =methods(g)
# 2 methods for generic function "g":
[1] g(; x, y) in Main at REPL[65]:1
[2] g(a; b) in Main at REPL[66]:1
julia> kwsorter_meths =methods(meths.mt.kwsorter)
# 2 methods for anonymous function "g##kw":
[1] (::var"#g##kw")(::Any, ::typeof(g)) in Main at REPL[65]:1
[2] (::var"#g##kw")(::Any, ::typeof(g), a) in Main at REPL[66]:1
julia> Base.uncompressed_ast(first(kwsorter_meths))
CodeInfo(
@ REPL[65]:1 within `g##kw'1 ── %1 = Base.haskey(@_2, :x)└─── goto #3 if not %12 ── @_6 = Base.getindex(@_2, :x)└─── goto #43 ── @_6 = 14 ┄─ x = @_6│ %7 = Base.haskey(@_2, :y)└─── goto #6 if not %75 ── @_7 = Base.getindex(@_2, :y)└─── goto #76 ── @_7 = 37 ┄─ y = @_7│ %13 = (:x, :y)│ %14 = Core.apply_type(Core.NamedTuple, %13)│ %15 = Base.structdiff(@_2, %14)│ %16 = Base.pairs(%15)│ %17 = Base.isempty(%16)└─── goto #9 if not %178 ── goto #109 ── Base.kwerr(@_2, @_3)10 ┄ %21 = Main.:(var"#g#10")(x, y, @_3)└─── return %21)
The text was updated successfully, but these errors were encountered:
oxinabox
changed the title
Add kwarg support to signature
Add full kwarg support to signature
Apr 14, 2020
Follow up for once #1 is merged.
Adding keyword support.
It is just really fiddly.
The information is there but its not in a very easy to acess form:
The text was updated successfully, but these errors were encountered: