Marc Reichelt
12/28/2023, 5:44 PMClassCastException  when run with 2.0.0-Beta2:
val Number.lightyears get() = Lightyears(this.toDouble())
val UInt.lightyears get() = Lightyears(this.toDouble())
data class Lightyears(val years: Double)
fun main() {
    println(2.lightyears)
    println(2U.lightyears)
}
Kotlin Playground: https://pl.kotl.in/0zkCeRL8P
This fails with:
Exception in thread "main" java.lang.ClassCastException: class kotlin.UInt cannot be cast to class java.lang.Number (kotlin.UInt is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')
Is this issue already known?mglukhikh
12/28/2023, 5:48 PMMarc Reichelt
12/28/2023, 5:58 PM