KT-3374 Wrong this@method receiver
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
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"
|
||||
}
|
||||
Reference in New Issue
Block a user