kirillrakhman
05/11/2016, 9:19 AMopen class Bar
abstract class Foo {
abstract val bar: Bar
fun foo() {
baz(bar!!) // Warning "Unnecessary non-null assertion"
baz(getBarX()!!) // No warning here
}
fun baz(bar: Bar) {
}
}
inline fun <reified T: Bar> Foo.getBarX() = bar as T
Why is no warning reported in the second case? Is this a bug? (created https://youtrack.jetbrains.com/issue/KT-12276)