JVM IR: make RemoveInlinedDeclarations a final module phase

Code in inline lambdas can call multifile part members. These calls are
replaced in GenerateMultifileFacades with the call to the facade member.
Previously this didn't happen though because the lambda body was removed
before the GenerateMultifileFacades phase, which led to
IllegalAccessError in the -Xmultifile-parts-inherit mode (because the
part class is package private in another package).
This commit is contained in:
Alexander Udalov
2019-11-15 00:41:45 +01:00
parent cdb7703947
commit 0daab88f97
6 changed files with 38 additions and 4 deletions
@@ -16497,6 +16497,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/multifileClasses/optimized"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("callInInlineLambda.kt")
public void testCallInInlineLambda() throws Exception {
runTest("compiler/testData/codegen/box/multifileClasses/optimized/callInInlineLambda.kt");
}
@TestMetadata("callableRefToConstVal.kt")
public void testCallableRefToConstVal() throws Exception {
runTest("compiler/testData/codegen/box/multifileClasses/optimized/callableRefToConstVal.kt");