Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/publicVals/open.fir.kt
T
Dmitriy Novozhilov 796f8e6bce Revert "FIR checkers: report SMARTCAST_IMPOSSIBLE"
This reverts commit 84334b08
2021-06-03 09:48:50 +03:00

12 lines
244 B
Kotlin
Vendored

public open class A() {
public open val foo: Int? = 1
}
infix fun Int.bar(i: Int) = i
fun test() {
val p = A()
// For open value properties, smart casts should not work
if (p.foo is Int) p.foo <!UNSAFE_INFIX_CALL!>bar<!> 11
}