Open soraros opened 2 months ago
cannot form a reference to overloaded declaration of '__le__'
This is intended behaviour. The real question is whether this method should be overloaded.
Will defer to @joe
This is intended behaviour. The real question is whether this method should be overloaded.
That's the thing: it's not overloaded, unless overloading means something very different in Mojo.
Ah, then this is indeed a bug
It also happens to Bool
, but for instance not to SIMD
.
The problem seems to be that @register_passable
doesn't work well with trait explicit bound (EqualityComparable
in this case). If either is removed, the problem goes away.
fn main():
Int.__eq__
@register_passable
struct Int(EqualityComparable):
fn __eq__(self, rhs: Self) -> Bool:
return False
fn __ne__(self, rhs: Self) -> Bool:
return False
Bug description
As title. It's odd since most other types work.
Steps to reproduce
System information