Closed ToucheSir closed 2 years ago
Would Expr[]
work on prior Julia versions? I expect Julia could just convert it to an Any[]
automatically.
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
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.
This is currently breaking Zygote CI on nightly: https://github.com/FluxML/Zygote.jl/pull/1219.