class DateRange(override val start: MyDate, override val endInclusive: MyDate) : Iterable<MyDate>, ClosedRange<MyDate> {
override operator fun iterator(): Iterator<MyDate> {
return DateIterator(this)
}
...
Here there wasn’t any problem, but if there were multiple interfaces that needs to be implemented having the same property name, how could it be implemented?
Yeah it would mean you can’t implement both. The workaround really depends on what you’re doing and what the interfaces are being used for (so I don’t have a general-purpose workaround), but you can almost always come up with another way of accomplishing what you want. The solution might even be to create two separate classes for the two conflicting interfaces, and have one adapt the other (with the adapter design pattern).