Files
kotlin-fork/compiler/testData/diagnostics/tests/thisAndSuper/thisInFunctionLiterals.fir.kt
T
2020-03-03 09:57:41 +03:00

18 lines
552 B
Kotlin
Vendored

// !CHECK_TYPE
class A(val a:Int) {
inner class B() {
fun Byte.xx() : Double.() -> Any {
checkSubtype<Byte>(this)
val a: Double.() -> Unit = {
checkSubtype<Double>(this)
checkSubtype<Byte>(this@xx)
checkSubtype<B>(this@B)
checkSubtype<A>(this@A)
}
val b: Double.() -> Unit = a@{ checkSubtype<Double>(this@a) + checkSubtype<Byte>(this@xx) }
val c = a@{ -> this@a + checkSubtype<Byte>(this@xx) }
return (a@{checkSubtype<Double>(this@a) + checkSubtype<Byte>(this@xx)})
}
}
}