Properly find invoke method on default lambda inlining
In general case parameter type could differ from actual default lambda type.
E.g.: fun inlineFun(s: (Child) -> Base = { a: Base -> a as Child}),
where type of default lambda is '(Base) -> Child'.
In such case we should find somehow actual invoke method in bytecode knowing
only name, number of parameters and that's actual invoke is non-synthetic
regardless of bridge one.
#KT-21946 Fixed
This commit is contained in:
Generated
+30
@@ -176,6 +176,11 @@ public class InlineDefaultValuesTestsGenerated extends AbstractInlineDefaultValu
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/defaultLambdaInNoInline.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("differentInvokeSignature.kt")
|
||||
public void testDifferentInvokeSignature() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/differentInvokeSignature.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericLambda.kt")
|
||||
public void testGenericLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/genericLambda.kt");
|
||||
@@ -196,6 +201,21 @@ public class InlineDefaultValuesTestsGenerated extends AbstractInlineDefaultValu
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/kt21827.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt21946.kt")
|
||||
public void testKt21946() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/kt21946.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt24477.kt")
|
||||
public void testKt24477() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/kt24477.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt25106.kt")
|
||||
public void testKt25106() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/kt25106.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noInline.kt")
|
||||
public void testNoInline() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/noInline.kt");
|
||||
@@ -313,6 +333,16 @@ public class InlineDefaultValuesTestsGenerated extends AbstractInlineDefaultValu
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/constuctorReference.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("differentInvokeSignature.kt")
|
||||
public void testDifferentInvokeSignature() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/differentInvokeSignature.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("differentInvokeSignature2.kt")
|
||||
public void testDifferentInvokeSignature2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/differentInvokeSignature2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionImportedFromObject.kt")
|
||||
public void testFunctionImportedFromObject() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionImportedFromObject.kt");
|
||||
|
||||
Generated
+30
@@ -176,6 +176,11 @@ public class IrInlineDefaultValuesTestsGenerated extends AbstractIrInlineDefault
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/defaultLambdaInNoInline.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("differentInvokeSignature.kt")
|
||||
public void testDifferentInvokeSignature() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/differentInvokeSignature.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericLambda.kt")
|
||||
public void testGenericLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/genericLambda.kt");
|
||||
@@ -196,6 +201,21 @@ public class IrInlineDefaultValuesTestsGenerated extends AbstractIrInlineDefault
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/kt21827.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt21946.kt")
|
||||
public void testKt21946() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/kt21946.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt24477.kt")
|
||||
public void testKt24477() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/kt24477.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt25106.kt")
|
||||
public void testKt25106() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/kt25106.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noInline.kt")
|
||||
public void testNoInline() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/noInline.kt");
|
||||
@@ -313,6 +333,16 @@ public class IrInlineDefaultValuesTestsGenerated extends AbstractIrInlineDefault
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/constuctorReference.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("differentInvokeSignature.kt")
|
||||
public void testDifferentInvokeSignature() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/differentInvokeSignature.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("differentInvokeSignature2.kt")
|
||||
public void testDifferentInvokeSignature2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/differentInvokeSignature2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionImportedFromObject.kt")
|
||||
public void testFunctionImportedFromObject() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionImportedFromObject.kt");
|
||||
|
||||
Reference in New Issue
Block a user