kirillrakhman
05/29/2017, 9:04 AMis
checks that are always false and eliminates the check itself when it's always true? This can be useful for inline functions:
inline fun <reified T: SomeInterface> T.foo() = when(this) {
is Fragment -> doFragmentStuff()
is Activity -> doActivityStuff()
else -> throw UnsupportedOperationException()
}