diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt index f6ff212108c..8362b4485f5 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt @@ -20,8 +20,7 @@ import com.intellij.psi.PsiElement import com.intellij.util.ArrayUtil import org.jetbrains.kotlin.builtins.BuiltInsPackageFragment import org.jetbrains.kotlin.codegen.* -import org.jetbrains.kotlin.codegen.AsmUtil.getMethodAsmFlags -import org.jetbrains.kotlin.codegen.AsmUtil.isPrimitive +import org.jetbrains.kotlin.codegen.AsmUtil.* import org.jetbrains.kotlin.codegen.coroutines.createMethodNodeForSuspendCoroutineOrReturn import org.jetbrains.kotlin.codegen.coroutines.isBuiltInSuspendCoroutineOrReturnInJvm import org.jetbrains.kotlin.codegen.intrinsics.bytecode @@ -657,7 +656,8 @@ class PsiInlineCodegen( val receiver = getBoundCallableReferenceReceiver(argumentExpression) if (receiver != null) { - putClosureParametersOnStack(lambdaInfo, codegen.gen(receiver)) + val receiverValue = codegen.gen(receiver) + putClosureParametersOnStack(lambdaInfo, StackValue.coercion(receiverValue, receiverValue.type.boxReceiverForBoundReference())) } } else { diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/LambdaInfo.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/LambdaInfo.kt index ad117582109..df03e072e84 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/LambdaInfo.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/LambdaInfo.kt @@ -105,6 +105,9 @@ class DefaultLambda( override fun isMyLabel(name: String): Boolean = false + var originalBoundReceiverType: Type? = null + private set + override fun generateLambdaBody(sourceCompiler: SourceCompilerForInline, reifiedTypeInliner: ReifiedTypeInliner) { val classReader = buildClassReaderByInternalName(sourceCompiler.state, lambdaClassType.internalName) var isPropertyReference = false @@ -141,7 +144,8 @@ class DefaultLambda( capturedVars = if (isFunctionReference || isPropertyReference) constructor?.desc?.let { Type.getArgumentTypes(it) }?.singleOrNull()?.let { - listOf(capturedParamDesc(AsmUtil.RECEIVER_NAME, it)) + originalBoundReceiverType = it + listOf(capturedParamDesc(AsmUtil.RECEIVER_NAME, it.boxReceiverForBoundReference())) } ?: emptyList() else constructor?.findCapturedFieldAssignmentInstructions()?.map { @@ -169,6 +173,9 @@ class DefaultLambda( } } +fun Type.boxReceiverForBoundReference() = AsmUtil.boxType(this) + + class ExpressionLambda( expression: KtExpression, private val typeMapper: KotlinTypeMapper, @@ -237,7 +244,9 @@ class ExpressionLambda( } if (closure.captureReceiverType != null) { - val type = typeMapper.mapType(closure.captureReceiverType!!) + val type = typeMapper.mapType(closure.captureReceiverType!!).let { + if (isBoundCallableReference) it.boxReceiverForBoundReference() else it + } val descriptor = EnclosedValueDescriptor( AsmUtil.CAPTURED_RECEIVER_FIELD, null, StackValue.field(type, lambdaClassType, AsmUtil.CAPTURED_RECEIVER_FIELD, false, StackValue.LOCAL_0), diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/MethodInliner.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/MethodInliner.kt index b7a59f87f5e..752e19d02d7 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/MethodInliner.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/MethodInliner.kt @@ -16,6 +16,7 @@ package org.jetbrains.kotlin.codegen.inline +import org.jetbrains.kotlin.codegen.AsmUtil import org.jetbrains.kotlin.codegen.ClosureCodegen import org.jetbrains.kotlin.codegen.StackValue import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicMethods @@ -347,6 +348,10 @@ class MethodInliner( val lambda = getLambdaIfExists(index) as DefaultLambda lambda.parameterOffsetsInDefault.zip(lambda.capturedVars).asReversed().forEach { (_, captured) -> + val originalBoundReceiverType = lambda.originalBoundReceiverType + if (lambda.isBoundCallableReference && AsmUtil.isPrimitive(originalBoundReceiverType)) { + StackValue.onStack(originalBoundReceiverType!!).put(captured.type, InstructionAdapter(this)) + } super.visitFieldInsn( Opcodes.PUTSTATIC, captured.containingLambdaName, CAPTURED_FIELD_FOLD_PREFIX + captured.fieldName, captured.type.descriptor ) diff --git a/compiler/testData/codegen/boxInline/callableReference/bound/kt18728.kt b/compiler/testData/codegen/boxInline/callableReference/bound/kt18728.kt new file mode 100644 index 00000000000..8da9f6097a1 --- /dev/null +++ b/compiler/testData/codegen/boxInline/callableReference/bound/kt18728.kt @@ -0,0 +1,16 @@ +// FILE: 1.kt + +package test + +inline fun T.map(transform: (T) -> R): R { + return transform(this) +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + val result = 1.map(2::plus) + return if (result == 3) "OK" else "fail $result" +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/callableReference/bound/kt18728_2.kt b/compiler/testData/codegen/boxInline/callableReference/bound/kt18728_2.kt new file mode 100644 index 00000000000..164bc0ee3ec --- /dev/null +++ b/compiler/testData/codegen/boxInline/callableReference/bound/kt18728_2.kt @@ -0,0 +1,16 @@ +// FILE: 1.kt + +package test + +inline fun T.map(transform: (T) -> R): R { + return transform(this) +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + val result = 1.map(3L::plus) + return if (result == 4L) "OK" else "fail $result" +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/callableReference/bound/kt18728_3.kt b/compiler/testData/codegen/boxInline/callableReference/bound/kt18728_3.kt new file mode 100644 index 00000000000..40df3101338 --- /dev/null +++ b/compiler/testData/codegen/boxInline/callableReference/bound/kt18728_3.kt @@ -0,0 +1,19 @@ +// FILE: 1.kt + +package test + +inline fun map(transform: () -> R): R { + return transform() +} + +// FILE: 2.kt + +import test.* + +val Int.myInc + get() = this + 1 + +fun box(): String { + val result = map(2::myInc) + return if (result == 3) "OK" else "fail $result" +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/callableReference/bound/kt18728_4.kt b/compiler/testData/codegen/boxInline/callableReference/bound/kt18728_4.kt new file mode 100644 index 00000000000..0bcc8fd80d4 --- /dev/null +++ b/compiler/testData/codegen/boxInline/callableReference/bound/kt18728_4.kt @@ -0,0 +1,18 @@ +// FILE: 1.kt + +package test + +inline fun map(transform: () -> R): R { + return transform() +} + +// FILE: 2.kt + +import test.* +val Long.myInc + get() = this + 1 + +fun box(): String { + val result = map(2L::myInc) + return if (result == 3L) "OK" else "fail $result" +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnInt.kt b/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnInt.kt new file mode 100644 index 00000000000..9fd1b67261d --- /dev/null +++ b/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnInt.kt @@ -0,0 +1,17 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +inline fun inlineFun(a: Int, lambda: (Int) -> Int = 1::plus): Int { + return lambda(a) +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + val result = inlineFun(2) + return if (result == 3) return "OK" else "fail $result" +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnLong.kt b/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnLong.kt new file mode 100644 index 00000000000..9fd1b67261d --- /dev/null +++ b/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnLong.kt @@ -0,0 +1,17 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +inline fun inlineFun(a: Int, lambda: (Int) -> Int = 1::plus): Int { + return lambda(a) +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + val result = inlineFun(2) + return if (result == 3) return "OK" else "fail $result" +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnInt.kt b/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnInt.kt new file mode 100644 index 00000000000..18acbd44ecd --- /dev/null +++ b/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnInt.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +val Int.myInc + get() = this + 1 + + +inline fun inlineFun(lambda: () -> Int = 1::myInc): Int { + return lambda() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + val result = inlineFun() + return if (result == 2) return "OK" else "fail $result" +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnLong.kt b/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnLong.kt new file mode 100644 index 00000000000..250edbe0877 --- /dev/null +++ b/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnLong.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +val Long.myInc + get() = this + 1 + + +inline fun inlineFun(lambda: () -> Long = 1L::myInc): Long { + return lambda() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + val result = inlineFun() + return if (result == 2L) return "OK" else "fail $result" +} \ No newline at end of file diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index b73827124ad..b0a13a2d3ef 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -736,6 +736,30 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli doTest(fileName); } + @TestMetadata("kt18728.kt") + public void testKt18728() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_2.kt") + public void testKt18728_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_2.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_3.kt") + public void testKt18728_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_3.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_4.kt") + public void testKt18728_4() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_4.kt"); + doTest(fileName); + } + @TestMetadata("map.kt") public void testMap() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/map.kt"); @@ -1161,12 +1185,36 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli doTest(fileName); } + @TestMetadata("boundFunctionReferenceOnInt.kt") + public void testBoundFunctionReferenceOnInt() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnInt.kt"); + doTest(fileName); + } + + @TestMetadata("boundFunctionReferenceOnLong.kt") + public void testBoundFunctionReferenceOnLong() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnLong.kt"); + doTest(fileName); + } + @TestMetadata("boundPropertyReference.kt") public void testBoundPropertyReference() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReference.kt"); doTest(fileName); } + @TestMetadata("boundPropertyReferenceOnInt.kt") + public void testBoundPropertyReferenceOnInt() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnInt.kt"); + doTest(fileName); + } + + @TestMetadata("boundPropertyReferenceOnLong.kt") + public void testBoundPropertyReferenceOnLong() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnLong.kt"); + doTest(fileName); + } + @TestMetadata("constuctorReference.kt") public void testConstuctorReference() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/constuctorReference.kt"); diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java index e73262c5172..2e47cdfb076 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -736,6 +736,30 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC doTest(fileName); } + @TestMetadata("kt18728.kt") + public void testKt18728() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_2.kt") + public void testKt18728_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_2.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_3.kt") + public void testKt18728_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_3.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_4.kt") + public void testKt18728_4() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_4.kt"); + doTest(fileName); + } + @TestMetadata("map.kt") public void testMap() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/map.kt"); @@ -1161,12 +1185,36 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC doTest(fileName); } + @TestMetadata("boundFunctionReferenceOnInt.kt") + public void testBoundFunctionReferenceOnInt() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnInt.kt"); + doTest(fileName); + } + + @TestMetadata("boundFunctionReferenceOnLong.kt") + public void testBoundFunctionReferenceOnLong() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnLong.kt"); + doTest(fileName); + } + @TestMetadata("boundPropertyReference.kt") public void testBoundPropertyReference() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReference.kt"); doTest(fileName); } + @TestMetadata("boundPropertyReferenceOnInt.kt") + public void testBoundPropertyReferenceOnInt() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnInt.kt"); + doTest(fileName); + } + + @TestMetadata("boundPropertyReferenceOnLong.kt") + public void testBoundPropertyReferenceOnLong() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnLong.kt"); + doTest(fileName); + } + @TestMetadata("constuctorReference.kt") public void testConstuctorReference() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/constuctorReference.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index e152f704d17..054c8ab02ef 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -736,6 +736,30 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo doTest(fileName); } + @TestMetadata("kt18728.kt") + public void testKt18728() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_2.kt") + public void testKt18728_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_2.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_3.kt") + public void testKt18728_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_3.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_4.kt") + public void testKt18728_4() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_4.kt"); + doTest(fileName); + } + @TestMetadata("map.kt") public void testMap() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/map.kt"); @@ -1161,12 +1185,36 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo doTest(fileName); } + @TestMetadata("boundFunctionReferenceOnInt.kt") + public void testBoundFunctionReferenceOnInt() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnInt.kt"); + doTest(fileName); + } + + @TestMetadata("boundFunctionReferenceOnLong.kt") + public void testBoundFunctionReferenceOnLong() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnLong.kt"); + doTest(fileName); + } + @TestMetadata("boundPropertyReference.kt") public void testBoundPropertyReference() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReference.kt"); doTest(fileName); } + @TestMetadata("boundPropertyReferenceOnInt.kt") + public void testBoundPropertyReferenceOnInt() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnInt.kt"); + doTest(fileName); + } + + @TestMetadata("boundPropertyReferenceOnLong.kt") + public void testBoundPropertyReferenceOnLong() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnLong.kt"); + doTest(fileName); + } + @TestMetadata("constuctorReference.kt") public void testConstuctorReference() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/constuctorReference.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index aa572518dd4..2a934173bf8 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -736,6 +736,30 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi doTest(fileName); } + @TestMetadata("kt18728.kt") + public void testKt18728() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_2.kt") + public void testKt18728_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_2.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_3.kt") + public void testKt18728_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_3.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_4.kt") + public void testKt18728_4() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_4.kt"); + doTest(fileName); + } + @TestMetadata("map.kt") public void testMap() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/map.kt"); @@ -1161,12 +1185,36 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi doTest(fileName); } + @TestMetadata("boundFunctionReferenceOnInt.kt") + public void testBoundFunctionReferenceOnInt() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnInt.kt"); + doTest(fileName); + } + + @TestMetadata("boundFunctionReferenceOnLong.kt") + public void testBoundFunctionReferenceOnLong() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnLong.kt"); + doTest(fileName); + } + @TestMetadata("boundPropertyReference.kt") public void testBoundPropertyReference() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReference.kt"); doTest(fileName); } + @TestMetadata("boundPropertyReferenceOnInt.kt") + public void testBoundPropertyReferenceOnInt() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnInt.kt"); + doTest(fileName); + } + + @TestMetadata("boundPropertyReferenceOnLong.kt") + public void testBoundPropertyReferenceOnLong() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnLong.kt"); + doTest(fileName); + } + @TestMetadata("constuctorReference.kt") public void testConstuctorReference() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/constuctorReference.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/CallableReferenceInlineTestsGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/CallableReferenceInlineTestsGenerated.java index 2e36f110bb7..520b787e575 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/CallableReferenceInlineTestsGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/CallableReferenceInlineTestsGenerated.java @@ -140,6 +140,30 @@ public class CallableReferenceInlineTestsGenerated extends AbstractCallableRefer doTest(fileName); } + @TestMetadata("kt18728.kt") + public void testKt18728() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_2.kt") + public void testKt18728_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_2.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_3.kt") + public void testKt18728_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_3.kt"); + doTest(fileName); + } + + @TestMetadata("kt18728_4.kt") + public void testKt18728_4() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/kt18728_4.kt"); + doTest(fileName); + } + @TestMetadata("map.kt") public void testMap() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/callableReference/bound/map.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineDefaultValuesTestsGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineDefaultValuesTestsGenerated.java index 777d73b4856..332ca34b7be 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineDefaultValuesTestsGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineDefaultValuesTestsGenerated.java @@ -274,12 +274,36 @@ public class InlineDefaultValuesTestsGenerated extends AbstractInlineDefaultValu doTest(fileName); } + @TestMetadata("boundFunctionReferenceOnInt.kt") + public void testBoundFunctionReferenceOnInt() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnInt.kt"); + doTest(fileName); + } + + @TestMetadata("boundFunctionReferenceOnLong.kt") + public void testBoundFunctionReferenceOnLong() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnLong.kt"); + doTest(fileName); + } + @TestMetadata("boundPropertyReference.kt") public void testBoundPropertyReference() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReference.kt"); doTest(fileName); } + @TestMetadata("boundPropertyReferenceOnInt.kt") + public void testBoundPropertyReferenceOnInt() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnInt.kt"); + doTest(fileName); + } + + @TestMetadata("boundPropertyReferenceOnLong.kt") + public void testBoundPropertyReferenceOnLong() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnLong.kt"); + doTest(fileName); + } + @TestMetadata("constuctorReference.kt") public void testConstuctorReference() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/constuctorReference.kt");