<Kotlin Koans Operators Overloading> I wrote a sep...
# stackoverflow
r
Kotlin Koans Operators Overloading I wrote a separate project with the following code, and I feel that the program performs as I expected. Why can't this write through the Kotlin Koans test? import TimeInterval.* data class MyDate(val year: Int, val month: Int, val dayOfMonth: Int) // Supported intervals that might be added to dates: enum class TimeInterval(var n: Int = 1) { DAY, WEEK, YEAR } operator fun TimeInterval.times(times: Int): TimeInterval { n *= times return this } operator fun...