JVM_IR indy-SAM conversions: prohibit in crossinline lambdas
KT-44278 KT-26060 KT-42621
This commit is contained in:
+40
-22
@@ -18457,6 +18457,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("possibleOverrideClash.kt")
|
||||
public void testPossibleOverrideClash() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/possibleOverrideClash.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitiveVsWrapperInSam.kt")
|
||||
public void testPrimitiveVsWrapperInSam() throws Exception {
|
||||
@@ -18499,6 +18505,40 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Inline extends AbstractFirBlackBoxCodegenTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInInline() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("crossinlineLambda1.kt")
|
||||
public void testCrossinlineLambda1() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("crossinlineLambda2.kt")
|
||||
public void testCrossinlineLambda2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunInDifferentPackage.kt")
|
||||
public void testInlineFunInDifferentPackage() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineLambda1.kt")
|
||||
public void testInlineLambda1() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@@ -18580,28 +18620,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class InlineContext extends AbstractFirBlackBoxCodegenTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInInlineContext() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunInDifferentPackage.kt")
|
||||
public void testInlineFunInDifferentPackage() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineLambda1.kt")
|
||||
public void testInlineLambda1() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-4
@@ -19,6 +19,7 @@ import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.expressions.IrBlockBody
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpressionBody
|
||||
import org.jetbrains.kotlin.ir.expressions.IrFunctionReference
|
||||
import org.jetbrains.kotlin.ir.util.dump
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi
|
||||
|
||||
internal val fakeInliningLocalVariablesLowering = makeIrFilePhase(
|
||||
@@ -56,16 +57,22 @@ internal class FakeInliningLocalVariablesLowering(val context: JvmBackendContext
|
||||
}
|
||||
|
||||
private fun IrFunction.addFakeLocalVariable(name: String) {
|
||||
val oldBody = body
|
||||
context.createIrBuilder(symbol).run {
|
||||
body = irBlockBody {
|
||||
// Create temporary variable, but make sure it's origin is `DEFINED` so that
|
||||
// it will materialize in the code.
|
||||
// Also, do not forget to remove $$forInline suffix, otherwise, IDE will not be able to navigate to inline function.
|
||||
createTmpVariable(irInt(0), name.removeSuffix(FOR_INLINE_SUFFIX), origin = IrDeclarationOrigin.DEFINED)
|
||||
if (body is IrExpressionBody) {
|
||||
+irReturn((body as IrExpressionBody).expression)
|
||||
} else {
|
||||
(body as IrBlockBody).statements.forEach { +it }
|
||||
when (oldBody) {
|
||||
is IrExpressionBody -> {
|
||||
+irReturn(oldBody.expression)
|
||||
}
|
||||
is IrBlockBody ->
|
||||
oldBody.statements.forEach { +it }
|
||||
else -> {
|
||||
throw AssertionError("Unexpected body:\n${this@addFakeLocalVariable.dump()}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+26
-2
@@ -45,6 +45,8 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext)
|
||||
// function reference classes needed.
|
||||
private val ignoredFunctionReferences = mutableSetOf<IrCallableReference<*>>()
|
||||
|
||||
private val inlineLambdaToValueParameter = HashMap<IrFunction, IrValueParameter>()
|
||||
|
||||
private val IrFunctionReference.isIgnored: Boolean
|
||||
get() = (!type.isFunctionOrKFunction() && !isSuspendFunctionReference()) || ignoredFunctionReferences.contains(this)
|
||||
|
||||
@@ -56,7 +58,20 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext)
|
||||
(origin == null || origin == IrStatementOrigin.ADAPTED_FUNCTION_REFERENCE || origin == IrStatementOrigin.SUSPEND_CONVERSION)
|
||||
|
||||
override fun lower(irFile: IrFile) {
|
||||
ignoredFunctionReferences.addAll(IrInlineReferenceLocator.scan(context, irFile))
|
||||
irFile.accept(
|
||||
object : IrInlineReferenceLocator(context) {
|
||||
override fun visitInlineLambda(
|
||||
argument: IrFunctionReference,
|
||||
callee: IrFunction,
|
||||
parameter: IrValueParameter,
|
||||
scope: IrDeclaration
|
||||
) {
|
||||
ignoredFunctionReferences.add(argument)
|
||||
inlineLambdaToValueParameter[argument.symbol.owner] = parameter
|
||||
}
|
||||
},
|
||||
null
|
||||
)
|
||||
irFile.transformChildrenVoid(this)
|
||||
}
|
||||
|
||||
@@ -137,12 +152,21 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext)
|
||||
return false
|
||||
|
||||
// Can't use indy-based SAM conversion inside inline fun (Ok in inline lambda).
|
||||
if (target.parents.any { it is IrSimpleFunction && it.isInline && it.origin != IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA })
|
||||
if (target.parents.any { it.isInlineFunction() || it.isCrossinlineLambda() })
|
||||
return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
private fun IrDeclarationParent.isInlineFunction() =
|
||||
this is IrSimpleFunction && isInline && origin != IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA
|
||||
|
||||
private fun IrDeclarationParent.isCrossinlineLambda(): Boolean {
|
||||
val irFun = this as? IrSimpleFunction ?: return false
|
||||
return origin == IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA &&
|
||||
inlineLambdaToValueParameter[irFun]?.isCrossinline == true
|
||||
}
|
||||
|
||||
private fun IrType.isProhibitedTypeForIndySamConversion(): Boolean {
|
||||
if (this !is IrSimpleType) return false
|
||||
|
||||
|
||||
+1
@@ -221,6 +221,7 @@ private fun IrSimpleFunction.createMultifileDelegateIfNeeded(
|
||||
if (DescriptorVisibilities.isPrivate(originalVisibility) ||
|
||||
name == StaticInitializersLowering.clinitName ||
|
||||
origin == JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR ||
|
||||
origin == IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA ||
|
||||
// $annotations methods in the facade are only needed for const properties.
|
||||
(origin == JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_OR_TYPEALIAS_ANNOTATIONS &&
|
||||
(metadata as? MetadataSource.Property)?.isConst != true)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
// FILE: 1.kt
|
||||
inline fun cross(crossinline fn: () -> String) : Any =
|
||||
object {
|
||||
override fun toString(): String = fn()
|
||||
}
|
||||
|
||||
fun interface IFoo {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
fun foo(iFoo: IFoo) = iFoo.foo()
|
||||
|
||||
// FILE: 2.kt
|
||||
fun box() =
|
||||
cross {
|
||||
foo { "OK" }
|
||||
}.toString()
|
||||
@@ -0,0 +1,26 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
// FILE: 1.kt
|
||||
class C {
|
||||
fun test() =
|
||||
cross {
|
||||
foo { "OK" }
|
||||
}.toString()
|
||||
}
|
||||
|
||||
inline fun cross(crossinline fn: () -> String) : Any =
|
||||
object {
|
||||
override fun toString(): String = fn()
|
||||
}
|
||||
|
||||
fun interface IFoo {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
fun foo(iFoo: IFoo) = iFoo.foo()
|
||||
|
||||
// FILE: 2.kt
|
||||
fun box() =
|
||||
C().test()
|
||||
|
||||
+2
-2
@@ -2,12 +2,12 @@
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
// WITH_RUNTIME
|
||||
// FILE: inlineFunInDifferentPackage.kt
|
||||
// FILE: 2.kt
|
||||
import a.*
|
||||
|
||||
fun box() = test { k -> "O" + k }
|
||||
|
||||
// FILE: a.kt
|
||||
// FILE: 1.kt
|
||||
package a
|
||||
|
||||
fun interface IFoo {
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
fun interface IFoo {
|
||||
fun foo()
|
||||
}
|
||||
@@ -13,6 +14,7 @@ inline fun twice(fn: () -> Unit) {
|
||||
fn()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
fun box(): String {
|
||||
var test = 0
|
||||
twice {
|
||||
@@ -0,0 +1,19 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
fun interface IFoo {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
fun foo(iFoo: IFoo) = iFoo.foo()
|
||||
|
||||
open class C1 {
|
||||
open fun test() = foo { "O" }
|
||||
}
|
||||
|
||||
class C2 : C1() {
|
||||
override fun test() = foo { "K" }
|
||||
}
|
||||
|
||||
fun box() =
|
||||
C1().test() + C2().test()
|
||||
+40
-22
@@ -18457,6 +18457,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("possibleOverrideClash.kt")
|
||||
public void testPossibleOverrideClash() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/possibleOverrideClash.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitiveVsWrapperInSam.kt")
|
||||
public void testPrimitiveVsWrapperInSam() throws Exception {
|
||||
@@ -18499,6 +18505,40 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Inline extends AbstractBlackBoxCodegenTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInInline() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("crossinlineLambda1.kt")
|
||||
public void testCrossinlineLambda1() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("crossinlineLambda2.kt")
|
||||
public void testCrossinlineLambda2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunInDifferentPackage.kt")
|
||||
public void testInlineFunInDifferentPackage() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineLambda1.kt")
|
||||
public void testInlineLambda1() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@@ -18580,28 +18620,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class InlineContext extends AbstractBlackBoxCodegenTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInInlineContext() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunInDifferentPackage.kt")
|
||||
public void testInlineFunInDifferentPackage() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineLambda1.kt")
|
||||
public void testInlineLambda1() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+40
-22
@@ -18457,6 +18457,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("possibleOverrideClash.kt")
|
||||
public void testPossibleOverrideClash() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/possibleOverrideClash.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitiveVsWrapperInSam.kt")
|
||||
public void testPrimitiveVsWrapperInSam() throws Exception {
|
||||
@@ -18499,6 +18505,40 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Inline extends AbstractIrBlackBoxCodegenTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInInline() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("crossinlineLambda1.kt")
|
||||
public void testCrossinlineLambda1() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("crossinlineLambda2.kt")
|
||||
public void testCrossinlineLambda2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunInDifferentPackage.kt")
|
||||
public void testInlineFunInDifferentPackage() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineLambda1.kt")
|
||||
public void testInlineLambda1() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@@ -18580,28 +18620,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class InlineContext extends AbstractIrBlackBoxCodegenTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInInlineContext() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunInDifferentPackage.kt")
|
||||
public void testInlineFunInDifferentPackage() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineLambda1.kt")
|
||||
public void testInlineLambda1() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+38
-23
@@ -16183,6 +16183,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("possibleOverrideClash.kt")
|
||||
public void testPossibleOverrideClash() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/possibleOverrideClash.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primitiveVsWrapperInSam.kt")
|
||||
public void testPrimitiveVsWrapperInSam() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt");
|
||||
@@ -16218,6 +16223,39 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Inline extends AbstractLightAnalysisModeTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInInline() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("crossinlineLambda1.kt")
|
||||
public void testCrossinlineLambda1() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("crossinlineLambda2.kt")
|
||||
public void testCrossinlineLambda2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineFunInDifferentPackage.kt")
|
||||
public void testInlineFunInDifferentPackage() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineLambda1.kt")
|
||||
public void testInlineLambda1() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
@@ -16290,29 +16328,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class InlineContext extends AbstractLightAnalysisModeTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInInlineContext() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("inlineFunInDifferentPackage.kt")
|
||||
public void testInlineFunInDifferentPackage() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineLambda1.kt")
|
||||
public void testInlineLambda1() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+13
-13
@@ -13903,6 +13903,19 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Inline extends AbstractIrJsCodegenBoxES6Test {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInInline() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
@@ -13915,19 +13928,6 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class InlineContext extends AbstractIrJsCodegenBoxES6Test {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInInlineContext() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Generated
+13
-13
@@ -13903,6 +13903,19 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Inline extends AbstractIrJsCodegenBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInInline() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
@@ -13915,19 +13928,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class InlineContext extends AbstractIrJsCodegenBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInInlineContext() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Generated
+13
-13
@@ -13968,6 +13968,19 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Inline extends AbstractJsCodegenBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInInline() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
@@ -13980,19 +13993,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class InlineContext extends AbstractJsCodegenBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInInlineContext() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+13
-13
@@ -8064,6 +8064,19 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Inline extends AbstractIrCodegenBoxWasmTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInInline() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
@@ -8076,19 +8089,6 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class InlineContext extends AbstractIrCodegenBoxWasmTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInInlineContext() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user