blob: cf541e2edb46da6a21e2fe0b54d4ec9e344bf5c3 [file] [log] [blame]
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"
}