Fix and refactor ExpressionCodegen#pushClosureOnStack

- change Closure parameter to ClassDescriptor, load closure in the beginning
- invert and rename boolean parameter, also use it only to prevent pushing
  dispatch receiver (not the extension receiver) onto the stack because the
  only non-trivial usage of it is preceded by manual handling of the dispatch
  (not extension) receiver. This fixes innerOfLocalCaptureExtensionReceiver.kt
This commit is contained in:
Alexander Udalov
2014-10-14 14:23:41 +04:00
parent 79123d6bb6
commit 7315146753
7 changed files with 79 additions and 50 deletions
@@ -4191,6 +4191,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("innerOfLocalCaptureExtensionReceiver.kt")
public void testInnerOfLocalCaptureExtensionReceiver() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/localClasses/innerOfLocalCaptureExtensionReceiver.kt");
doTest(fileName);
}
@TestMetadata("kt2700.kt")
public void testKt2700() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/localClasses/kt2700.kt");
@@ -4227,6 +4233,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("localClassCaptureExtensionReceiver.kt")
public void testLocalClassCaptureExtensionReceiver() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/localClasses/localClassCaptureExtensionReceiver.kt");
doTest(fileName);
}
@TestMetadata("localClassInInitializer.kt")
public void testLocalClassInInitializer() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/localClasses/localClassInInitializer.kt");