I have the following function: ``` fun <T : Ent...
# announcements
s
I have the following function:
Copy code
fun <T : Entity> write(entity: T) {
    when (entity) {
        is One -> doSomething(entity)
        is Two -> {}
        // etc 
    }
}
But when I'm trying to do
is One, is Two -> doSomething(entity)
I basically loose the smart cast and get
Type mismatch: expected XXX found T
compile error. Is there a way to smart cast multiple types on a single line or do I need to keep each on a separate branch of
when
?