melatonina
03/17/2021, 12:29 PMelizarov
03/17/2021, 12:48 PMmelatonina
03/17/2021, 1:10 PMCaused by: java.lang.ClassCastException: class com.aeyeonmovement.FrameIndex cannot be cast to class java.lang.Number (com.aeyeonmovement.FrameIndex is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')
melatonina
03/17/2021, 1:11 PMmelatonina
03/17/2021, 1:14 PMException in thread "JavaFX Application Thread @coroutine#15" java.lang.ClassCastException: class com.aeyeonmovement.FrameIndex cannot be cast to class java.lang.Number (com.aeyeonmovement.FrameIndex is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')
at com.aeyeonmovement.FrameIndex.next-t4yMDwI(FrameIndex.kt:7)
at com.aeyeonmovement.FrameIndexRange$Iterator.next-t4yMDwI(FrameIndexRange.kt:60)
at com.aeyeonmovement.FrameIndexRange$Iterator.next(FrameIndexRange.kt:55)
melatonina
03/17/2021, 1:18 PMnext()
is called. FrameIndex
implements Index<FrameIndex>
which is defined as:
interface Index<T> : Comparable<T> {
val value : Int
val number get() = value + 1
val isStrictlyNegative get() =
value < 0
val isPositive get() =
value >= 0
val isOdd: Boolean get() = value % 2 != 0
operator fun plus(n : Int) : T
operator fun minus(n : Int) : T
fun next() : T = this + 1
fun previous() : T = this - 1
val parity get() = Parity.of(value)
}
That next()
method is the one that is called.melatonina
03/17/2021, 1:20 PMFrameIndex
needs to be cast to Number
.