// PROBLEM: none // WITH_RUNTIME class A { val list: MutableList = mutableListOf() } class B { val list: MutableList = mutableListOf() } fun Any.add(s: String) { when (this) { is A -> list += s is B -> list += s else -> throw IllegalStateException() } }