Pavel Lahoda
05/22/2023, 11:22 AMfun get(): Any?
In my iOS implementation I have:
*func* get() -> *Any*? {
*return* Int(0)
}
Which I call from KMM as:
val myValue = myImplementation.get() as Int
and I am getting the following Exception:
kotlin.ClassCastException: class kotlin.Long cannot be cast to class <http://kotlin.Int|kotlin.Int>
Not sure why this might happen. Any comments/ideas are welcome. ThanksTijl
05/22/2023, 11:25 AMCasey Brooks
05/22/2023, 2:01 PM.toInt()
, .toLong()
, .toDouble()
, etc)Pavel Lahoda
05/22/2023, 3:17 PMPavel Lahoda
05/22/2023, 3:18 PMCasey Brooks
05/22/2023, 3:18 PMCasey Brooks
05/22/2023, 3:23 PM.toInt()
on that result. (myImplementation.get() as Long).toInt()
Pavel Lahoda
05/22/2023, 3:30 PM