As designed KT-5930: Wrong execution order in case of extension function

#KT-5930 As Designed
This commit is contained in:
Michael Bogdanov
2014-10-13 11:22:22 +04:00
parent 5abc2dac4e
commit a88e9666e4
2 changed files with 25 additions and 0 deletions
@@ -0,0 +1,19 @@
var result = ""
fun getReceiver() : Int {
result += "getReceiver->"
return 1
}
fun getFun(b : Int.(Int)->Unit): Int.(Int)->Unit {
result += "getFun()->"
return b
}
fun box(): String {
getReceiver().(getFun({ result +="End" }))(1)
if(result != "getFun()->getReceiver->End") return "fail $result"
return "OK"
}