Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/classObjectMember.kt
T
Svetlana Isakova d3e6d2d6cd do not need to check stand-alone class object for class,
when it's on the left hand side of dot it is analyzed in 'getIdForImplicitReceiver' (test added)
2013-07-05 18:03:52 +04:00

22 lines
255 B
Kotlin

open class T {
val x : Int? = null
}
class A {
class object: T() {
}
}
class B {
class object: T() {
}
}
fun test() {
if (A.x != null) {
useInt(A.x)
useInt(<!TYPE_MISMATCH!>B.x<!>)
}
}
fun useInt(i: Int) = i