<@U5VE1UMQT> Well the compiler already does this f...
# random
k
@Bob Well the compiler already does this for normal if statements on sealed classes, so it's not really a problem if there are many of them.
b
karelpeeters: does what exactly?
k
It looks like my memory failed me, I thought this worked:
Copy code
sealed class Base

class A(val a: String) : Base()
class B(val b: String) : Base()

fun foo(base: Base) {
    if (base is A) {
        print(base.a)
    } else {
        print(base.b)
    }
}
But is doesn't...
I created an issue here: https://youtrack.jetbrains.com/issue/KT-18950, I couldn't really find a dupliciate.