I’m running Julia 1.6.2. Not sure what’s going wrong here:
struct Foo end
Base.promote_rule(::Type{Foo}, ::Type{Float64}) = Foo
@show Base.promote(Foo, Float64)
I get
$ julia bug.jl
Base.promote(Foo, Float64) = (Foo, Float64)
whereas I’d expect it to return Foo
.
I believe I’m following the docs almost word-for-word. What’s going on here?