fun F.bar() { } inline fun test_1(x: Any) { when { x is T -> { // BLOCK x /*as T */.bar() } } } fun test_2(x: Any?) { when { x is CharSequence -> { // BLOCK x /*as CharSequence */.bar() } } }