Files
kotlin-fork/compiler/testData/diagnostics/tests/dataClasses/componentFunctionInSubClass.kt
T
2015-04-29 16:33:24 +02:00

14 lines
260 B
Kotlin
Vendored

// !CHECK_TYPE
open data class A(private val x: Int)
class B : A(1) {
fun component1(): String = ""
}
fun foo() {
val b = B()
checkSubtype<String>(b.component1())
checkSubtype<Int>((checkSubtype<A>(b)).<!INVISIBLE_MEMBER!>component1<!>())
}