but when I do Foo..Foo its a type of ClosedRange&l...
# announcements
but when I do Foo..Foo its a type of ClosedRange<Foo> insead of FooRange that I've implemented
You need to overload the range operator:
Copy code
operator fun Foo.rangeTo(other: Foo) = FooRange(...)
❤️ 1
many thanks! ❤️
didn't know I have to overload the range too
@diesieben07 I did so
Copy code
class IpAddressRange(
    start: Ipv4Address,
    endInclusive: Ipv4Address
) : ClosedRange<Ipv4Address>, IpAddressProgression(start, endInclusive)

operator fun Ipv4Address.rangeTo(other: Ipv4Address) = IpAddressRange(this, other)
and it worked at first but then I moved it to other module and broke, any ideas?
Make sure you import the function
damn indeed
thanks again