ClassCastException on inline class

I got an error on this code

fun main() {
    println(N(2) in minOf(N(0), N(1))..N(3))
}

inline class N(val v: Int) : Comparable<N> {
    override fun compareTo(other: N) = v.compareTo(other.v)
}
Exception in thread "main" java.lang.ClassCastException: N cannot be cast to java.lang.Integer

Here the reproducer.

Is it related to KT-29075 or should a new issue be filed?

Thanks. Just to be safe I created a related issue: https://youtrack.jetbrains.com/issue/KT-36420

1 Like