As designed KT-5930: Wrong execution order in case of extension function
#KT-5930 As Designed
This commit is contained in:
@@ -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"
|
||||
}
|
||||
@@ -2765,6 +2765,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/extensionFunctions"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("executionOrder.kt")
|
||||
public void testExecutionOrder() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/extensionFunctions/executionOrder.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt1061.kt")
|
||||
public void testKt1061() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/extensionFunctions/kt1061.kt");
|
||||
|
||||
Reference in New Issue
Block a user