JVM_IR KT-41911 process big arity 'invoke' arguments recursively
This commit is contained in:
Generated
+5
@@ -12572,6 +12572,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/javaLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nestedBigArityFunCalls.kt")
|
||||
public void testNestedBigArityFunCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("subclass.kt")
|
||||
public void testSubclass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
|
||||
|
||||
+7
-2
@@ -57,16 +57,21 @@ private class FunctionNVarargBridgeLowering(val context: JvmBackendContext) :
|
||||
at(expression)
|
||||
irCall(functionNInvokeFun).apply {
|
||||
dispatchReceiver = irImplicitCast(
|
||||
expression.dispatchReceiver!!,
|
||||
expression.dispatchReceiver!!.transformVoid(),
|
||||
this@FunctionNVarargBridgeLowering.context.ir.symbols.functionN.defaultType
|
||||
)
|
||||
putValueArgument(0, irArray(irSymbols.array.typeWith(context.irBuiltIns.anyNType)) {
|
||||
(0 until expression.valueArgumentsCount).forEach { +expression.getValueArgument(it)!! }
|
||||
(0 until expression.valueArgumentsCount).forEach {
|
||||
+expression.getValueArgument(it)!!.transformVoid()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun IrExpression.transformVoid() =
|
||||
transform(this@FunctionNVarargBridgeLowering, null)
|
||||
|
||||
override fun visitClassNew(declaration: IrClass): IrStatement {
|
||||
val bigArityFunctionSuperTypes = declaration.superTypes.filterIsInstance<IrSimpleType>().filter {
|
||||
it.isFunctionType && it.arguments.size > BuiltInFunctionArity.BIG_ARITY
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
interface A
|
||||
object O : A
|
||||
|
||||
typealias F<T> = (A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, T) -> String
|
||||
|
||||
fun test(f: F<F<String>>): String =
|
||||
f(O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O) {
|
||||
_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, s ->
|
||||
s
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return test {
|
||||
_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, f ->
|
||||
f(O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, "OK")
|
||||
}
|
||||
}
|
||||
+5
@@ -13972,6 +13972,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/javaLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nestedBigArityFunCalls.kt")
|
||||
public void testNestedBigArityFunCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("subclass.kt")
|
||||
public void testSubclass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
|
||||
|
||||
+5
@@ -13972,6 +13972,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/javaLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nestedBigArityFunCalls.kt")
|
||||
public void testNestedBigArityFunCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("subclass.kt")
|
||||
public void testSubclass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
|
||||
|
||||
+5
@@ -12572,6 +12572,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/javaLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nestedBigArityFunCalls.kt")
|
||||
public void testNestedBigArityFunCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("subclass.kt")
|
||||
public void testSubclass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+5
@@ -10787,6 +10787,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/invokeMemberCallableReference.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nestedBigArityFunCalls.kt")
|
||||
public void testNestedBigArityFunCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("subclass.kt")
|
||||
public void testSubclass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
|
||||
|
||||
Generated
+5
@@ -10787,6 +10787,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/invokeMemberCallableReference.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nestedBigArityFunCalls.kt")
|
||||
public void testNestedBigArityFunCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("subclass.kt")
|
||||
public void testSubclass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
|
||||
|
||||
Generated
+5
@@ -10787,6 +10787,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/invokeMemberCallableReference.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nestedBigArityFunCalls.kt")
|
||||
public void testNestedBigArityFunCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("subclass.kt")
|
||||
public void testSubclass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+5
@@ -5461,6 +5461,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
public void testAllFilesPresentInBigArity() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/functions/bigArity"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("nestedBigArityFunCalls.kt")
|
||||
public void testNestedBigArityFunCalls() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/functions/functionExpression")
|
||||
|
||||
Reference in New Issue
Block a user