FluxML / IRTools.jl

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

Adapt to https://github.com/JuliaLang/julia/pull/45204 #99

Closed ToucheSir closed 2 years ago

ToucheSir commented 2 years ago

This is currently breaking Zygote CI on nightly: https://github.com/FluxML/Zygote.jl/pull/1219.

MikeInnes commented 2 years ago

Would Expr[] work on prior Julia versions? I expect Julia could just convert it to an Any[] automatically.

ToucheSir commented 2 years ago

Doesn't seem like it, unfortunately:

julia> foo(x::Vector{Any}) = typeof(x)
foo (generic function with 1 method)

julia> foo(Expr[])
ERROR: MethodError: no method matching foo(::Vector{Expr})
Closest candidates are:
  foo(::Vector{Any}) at REPL[1]:1
Stacktrace:
 [1] top-level scope
   @ REPL[2]:1
MikeInnes commented 2 years ago

Ok, this would work by default but I see that the patch you linked adds a restrictive type constraint to the constructor. Oh well. Thanks for the fix.