Temporary disable local fun inlining (it's not supported now)
This commit is contained in:
@@ -2222,7 +2222,8 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
||||
boolean isInline = state.isInlineEnabled() &&
|
||||
descriptor instanceof SimpleFunctionDescriptor &&
|
||||
((SimpleFunctionDescriptor) descriptor).getInlineStrategy().isInline();
|
||||
if (!isInline) return defaultCallGenerator;
|
||||
//TODO: support local fun inlining
|
||||
if (!isInline || isLocalNamedFun(descriptor)) return defaultCallGenerator;
|
||||
|
||||
SimpleFunctionDescriptor original = DescriptorUtils.unwrapFakeOverride((SimpleFunctionDescriptor) descriptor.getOriginal());
|
||||
return new InlineCodegen(this, state, original, callElement);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
fun box(): String {
|
||||
val s = "OK"
|
||||
|
||||
[inline] fun localFun(): String {
|
||||
return s
|
||||
}
|
||||
|
||||
return localFun()
|
||||
}
|
||||
@@ -3493,6 +3493,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/functions/localFunctions"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("disabledInline.kt")
|
||||
public void testDisabledInline() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/functions/localFunctions/disabledInline.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt2895.kt")
|
||||
public void testKt2895() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/functions/localFunctions/kt2895.kt");
|
||||
|
||||
Reference in New Issue
Block a user