So I have a bit of code:
struct Foo val::Float64 end @show 0.0 <= Foo(0.0)
MethodError: no method matching isless(::Float64, ::Foo). Oh right, I forgot to define
struct Foo val::Float64 end function Base.isless(lhs::Float64, rhs::Foo) Base.isless(lhs, rhs.val) end @show 0.0 <= Foo(0.0) # this prints false!
Wait what… how is this possible? But 0.0 <= 0.0!
Does anyone have any idea what’s going on here? This strikes me as a bug.