Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/publicVals/open.kt
T
Mikhail Glukhikh 1544755838 Test refactoring
2015-04-14 19:11:26 +03:00

12 lines
241 B
Kotlin

public open class A() {
public open val foo: Int? = 1
}
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) <!SMARTCAST_IMPOSSIBLE!>p.foo<!> bar 11
}