Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/kt7110.kt
T
2015-10-14 20:39:35 +03:00

12 lines
248 B
Kotlin
Vendored

// Anonymous object's initialization does not affect smart casts
abstract class A(val s: String) {
fun bar(): String = s
}
fun foo(o: String?): Int {
val a = object : A(o!!){}
a.bar()
return <!DEBUG_INFO_SMARTCAST!>o<!>.length
}