Files
kotlin-fork/compiler/testData/codegen/box/extensionFunctions/thisMethodInObjectLiteral.kt
T
2018-06-28 12:26:41 +02:00

16 lines
295 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
class Test {
private fun <T : Any> T.self() = object{
fun calc() : T {
return this@self
}
}
fun box() : Int {
return 1.self().calc() + 1
}
}
fun box() : String {
return if (Test().box() == 2) "OK" else "fail"
}