FluxML / IRTools.jl

Mike's Little Intermediate Representation
MIT License
111 stars 35 forks source link

Can `@code_ir` support kwargs #103

Open skyleaworlder opened 1 year ago

skyleaworlder commented 1 year ago

Motivation and description

julia> example(a, b; c = 1) = a + b + c;

julia> @code_ir example(1, 2; c = 3)
ERROR: MethodError: no method matching typesof(::Int64, ::Int64; c=3)
Closest candidates are:
  typesof(::Any...) at errorshow.jl:178 got unsupported keyword argument "isend"
Stacktrace:
 [1] top-level scope
   @ REPL[45]:1

I think this is a very useful enhancement.

Possible Implementation

julia/macros.jl and typesof usage in gen_call_with_extracted_types.