JVM: support JVM-specific primitive/wrapper type overridability check

#KT-62045 Fixed
This commit is contained in:
Alexander Udalov
2023-09-08 17:50:00 +02:00
committed by Space Team
parent 39327a37cb
commit b2c30921e4
28 changed files with 848 additions and 1 deletions
@@ -31655,6 +31655,52 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
runTest("compiler/testData/codegen/box/javaInterop/objectMethods/cloneableClassWithoutClone.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("anotherKotlinClassInTheMiddle.kt")
public void testAnotherKotlinClassInTheMiddle() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/anotherKotlinClassInTheMiddle.kt");
}
@Test
@TestMetadata("diamond.kt")
public void testDiamond() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/diamond.kt");
}
@Test
@TestMetadata("double.kt")
public void testDouble() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/double.kt");
}
@Test
@TestMetadata("generic.kt")
public void testGeneric() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/generic.kt");
}
@Test
@TestMetadata("int.kt")
public void testInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/int.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/nullableInt.kt");
}
}
}
@Nested
@@ -31655,6 +31655,52 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
runTest("compiler/testData/codegen/box/javaInterop/objectMethods/cloneableClassWithoutClone.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("anotherKotlinClassInTheMiddle.kt")
public void testAnotherKotlinClassInTheMiddle() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/anotherKotlinClassInTheMiddle.kt");
}
@Test
@TestMetadata("diamond.kt")
public void testDiamond() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/diamond.kt");
}
@Test
@TestMetadata("double.kt")
public void testDouble() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/double.kt");
}
@Test
@TestMetadata("generic.kt")
public void testGeneric() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/generic.kt");
}
@Test
@TestMetadata("int.kt")
public void testInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/int.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/nullableInt.kt");
}
}
}
@Nested
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.fir.backend.jvm
import org.jetbrains.kotlin.backend.common.serialization.signature.PublicIdSignatureComputer
import org.jetbrains.kotlin.backend.jvm.*
import org.jetbrains.kotlin.backend.jvm.overrides.IrJavaIncompatibilityRulesOverridabilityCondition
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.config.JVMConfigurationKeys
import org.jetbrains.kotlin.config.JvmSerializeIrMode
@@ -36,7 +37,9 @@ class JvmFir2IrExtensions(
private val mangler: KotlinMangler.IrMangler,
) : Fir2IrExtensions, JvmGeneratorExtensions {
override val parametersAreAssignable: Boolean get() = true
override val externalOverridabilityConditions: List<IrExternalOverridabilityCondition> = emptyList() // TODO: KT-61370
override val externalOverridabilityConditions: List<IrExternalOverridabilityCondition>
get() = listOf(IrJavaIncompatibilityRulesOverridabilityCondition())
override val classNameOverride: MutableMap<IrClass, JvmClassName> = mutableMapOf()
override val cachedFields = CachedFieldsForObjectInstances(IrFactoryImpl, configuration.languageVersionSettings)
@@ -31304,6 +31304,52 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
runTest("compiler/testData/codegen/box/javaInterop/objectMethods/cloneableClassWithoutClone.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("anotherKotlinClassInTheMiddle.kt")
public void testAnotherKotlinClassInTheMiddle() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/anotherKotlinClassInTheMiddle.kt");
}
@Test
@TestMetadata("diamond.kt")
public void testDiamond() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/diamond.kt");
}
@Test
@TestMetadata("double.kt")
public void testDouble() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/double.kt");
}
@Test
@TestMetadata("generic.kt")
public void testGeneric() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/generic.kt");
}
@Test
@TestMetadata("int.kt")
public void testInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/int.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/nullableInt.kt");
}
}
}
@Nested
@@ -31304,6 +31304,52 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
runTest("compiler/testData/codegen/box/javaInterop/objectMethods/cloneableClassWithoutClone.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("anotherKotlinClassInTheMiddle.kt")
public void testAnotherKotlinClassInTheMiddle() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/anotherKotlinClassInTheMiddle.kt");
}
@Test
@TestMetadata("diamond.kt")
public void testDiamond() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/diamond.kt");
}
@Test
@TestMetadata("double.kt")
public void testDouble() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/double.kt");
}
@Test
@TestMetadata("generic.kt")
public void testGeneric() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/generic.kt");
}
@Test
@TestMetadata("int.kt")
public void testInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/int.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/nullableInt.kt");
}
}
}
@Nested
@@ -31304,6 +31304,52 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
runTest("compiler/testData/codegen/box/javaInterop/objectMethods/cloneableClassWithoutClone.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("anotherKotlinClassInTheMiddle.kt")
public void testAnotherKotlinClassInTheMiddle() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/anotherKotlinClassInTheMiddle.kt");
}
@Test
@TestMetadata("diamond.kt")
public void testDiamond() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/diamond.kt");
}
@Test
@TestMetadata("double.kt")
public void testDouble() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/double.kt");
}
@Test
@TestMetadata("generic.kt")
public void testGeneric() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/generic.kt");
}
@Test
@TestMetadata("int.kt")
public void testInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/int.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/nullableInt.kt");
}
}
}
@Nested
@@ -0,0 +1,64 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.backend.jvm.overrides
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
import org.jetbrains.kotlin.ir.overrides.IrExternalOverridabilityCondition
import org.jetbrains.kotlin.ir.overrides.IrExternalOverridabilityCondition.Contract
import org.jetbrains.kotlin.ir.overrides.IrExternalOverridabilityCondition.Result
import org.jetbrains.kotlin.ir.overrides.MemberWithOriginal
import org.jetbrains.kotlin.ir.types.getClass
import org.jetbrains.kotlin.ir.types.isPrimitiveType
import org.jetbrains.kotlin.ir.util.hasAnnotation
import org.jetbrains.kotlin.ir.util.isFromJava
import org.jetbrains.kotlin.ir.util.render
import org.jetbrains.kotlin.name.StandardClassIds
class IrJavaIncompatibilityRulesOverridabilityCondition : IrExternalOverridabilityCondition {
override fun isOverridable(
superMember: MemberWithOriginal,
subMember: MemberWithOriginal,
): Result {
if (doesJavaOverrideHaveIncompatibleValueParameterKinds(superMember, subMember)) {
return Result.INCOMPATIBLE
}
return Result.UNKNOWN
}
override val contract: Contract
get() = Contract.CONFLICTS_ONLY
private fun doesJavaOverrideHaveIncompatibleValueParameterKinds(
superMember: MemberWithOriginal,
subMember: MemberWithOriginal,
): Boolean {
val originalSuperMember = superMember.original as? IrSimpleFunction ?: return false
val originalSubMember = subMember.original as? IrSimpleFunction ?: return false
if (!originalSubMember.dispatchReceiverParameter!!.type.getClass()!!.isFromJava()) return false
require(originalSubMember.valueParameters.size == originalSuperMember.valueParameters.size) {
"External overridability condition with CONFLICTS_ONLY should not be run with different value parameters size: " +
"subMember=${originalSubMember.render()} superMember=${originalSuperMember.render()}"
}
return originalSubMember.valueParameters.indices.any { i ->
isJvmParameterTypePrimitive(originalSuperMember, i) != isJvmParameterTypePrimitive(originalSubMember, i)
}
}
private fun isJvmParameterTypePrimitive(function: IrSimpleFunction, index: Int): Boolean {
// K1's JavaIncompatibilityRulesOverridabilityCondition also performs some extra checks, which are missing here:
// 1) isPrimitiveCompareTo. This is not needed in case of IR fake overrides as long as we're not using IrFakeOverrideBuilder
// to build overrides for lazy IR, in particular for built-in classes (however this may change in KT-64352).
// 2) forceSingleValueParameterBoxing. This makes the only parameter of `remove(Int)` in a subclass of `MutableCollection<Int>`
// non-primitive. It's unclear what exactly it affects if overrides are built over IR.
// TODO (KT-65100): investigate whether forceSingleValueParameterBoxing is needed here and test properly.
val type = function.valueParameters[index].type
return type.isPrimitiveType() && !type.hasAnnotation(StandardClassIds.Annotations.FlexibleNullability)
&& !type.hasAnnotation(StandardClassIds.Annotations.EnhancedNullability)
}
}
@@ -0,0 +1,36 @@
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// IGNORE_LIGHT_ANALYSIS
// FILE: box.kt
class E : D()
fun box(): String =
E().foo(0)
// FILE: A.java
public interface A {
default String foo(Integer value) {
return "Fail: A";
}
}
// FILE: K.kt
interface K : A
// FILE: B.java
public abstract class B implements K {
public String foo(int value) {
return "OK";
}
}
// FILE: C.kt
open class C : B()
// FILE: D.java
public class D extends C {
@Override
public String foo(Integer value) {
return "Fail: D";
}
}
@@ -0,0 +1,39 @@
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// IGNORE_LIGHT_ANALYSIS
// FILE: box.kt
class E : D()
fun box(): String =
E().foo(0)
// FILE: A.java
public interface A {
default String foo(Integer value) {
return "Fail: A";
}
}
// FILE: B.java
public interface B extends A {
default String foo(int value) {
return "OK";
}
}
// FILE: AImpl.java
public abstract class AImpl implements A {}
// FILE: BImpl.java
public abstract class BImpl extends AImpl implements B {}
// FILE: C.kt
open class C : BImpl()
// FILE: D.java
public class D extends C {
@Override
public String foo(Integer value) {
return "Fail: D";
}
}
@@ -0,0 +1,33 @@
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// IGNORE_LIGHT_ANALYSIS
// FILE: box.kt
class E : D()
fun box(): String =
E().foo(0.0)
// FILE: A.java
public interface A {
default String foo(Double value) {
return "Fail: A";
}
}
// FILE: B.java
public abstract class B implements A {
public String foo(double value) {
return "OK";
}
}
// FILE: C.kt
open class C : B()
// FILE: D.java
public class D extends C {
@Override
public String foo(Double value) {
return "Fail: D";
}
}
@@ -0,0 +1,33 @@
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// IGNORE_LIGHT_ANALYSIS
// FILE: box.kt
class E : D()
fun box(): String =
E().foo(0.0)
// FILE: A.java
public interface A<T> {
default String foo(T value) {
return "Fail: A";
}
}
// FILE: B.java
public abstract class B implements A<Double> {
public String foo(double value) {
return "OK";
}
}
// FILE: C.kt
open class C : B()
// FILE: D.java
public class D extends C {
@Override
public String foo(Double value) {
return "Fail: D";
}
}
@@ -0,0 +1,33 @@
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// IGNORE_LIGHT_ANALYSIS
// FILE: box.kt
class E : D()
fun box(): String =
E().foo(0)
// FILE: A.java
public interface A {
default String foo(Integer value) {
return "Fail: A";
}
}
// FILE: B.java
public abstract class B implements A {
public String foo(int value) {
return "OK";
}
}
// FILE: C.kt
open class C : B()
// FILE: D.java
public class D extends C {
@Override
public String foo(Integer value) {
return "Fail: D";
}
}
@@ -0,0 +1,37 @@
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// IGNORE_LIGHT_ANALYSIS
// FILE: box.kt
class E : D()
fun box(): String =
E().foo(0)
// FILE: A.java
import org.jetbrains.annotations.Nullable;
public interface A {
default String foo(@Nullable Integer value) {
return "Fail: A";
}
}
// FILE: B.java
public abstract class B implements A {
public String foo(int value) {
return "OK";
}
}
// FILE: C.kt
open class C : B()
// FILE: D.java
import org.jetbrains.annotations.Nullable;
public class D extends C {
@Override
public String foo(@Nullable Integer value) {
return "Fail: D";
}
}
@@ -31304,6 +31304,52 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency
runTest("compiler/testData/codegen/box/javaInterop/objectMethods/cloneableClassWithoutClone.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("anotherKotlinClassInTheMiddle.kt")
public void testAnotherKotlinClassInTheMiddle() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/anotherKotlinClassInTheMiddle.kt");
}
@Test
@TestMetadata("diamond.kt")
public void testDiamond() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/diamond.kt");
}
@Test
@TestMetadata("double.kt")
public void testDouble() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/double.kt");
}
@Test
@TestMetadata("generic.kt")
public void testGeneric() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/generic.kt");
}
@Test
@TestMetadata("int.kt")
public void testInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/int.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/nullableInt.kt");
}
}
}
@Nested
@@ -29576,6 +29576,52 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/javaInterop/objectMethods/cloneableClassWithoutClone.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@Test
@TestMetadata("anotherKotlinClassInTheMiddle.kt")
public void testAnotherKotlinClassInTheMiddle() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/anotherKotlinClassInTheMiddle.kt");
}
@Test
@TestMetadata("diamond.kt")
public void testDiamond() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/diamond.kt");
}
@Test
@TestMetadata("double.kt")
public void testDouble() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/double.kt");
}
@Test
@TestMetadata("generic.kt")
public void testGeneric() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/generic.kt");
}
@Test
@TestMetadata("int.kt")
public void testInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/int.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/nullableInt.kt");
}
}
}
@Nested
@@ -31304,6 +31304,52 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/javaInterop/objectMethods/cloneableClassWithoutClone.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("anotherKotlinClassInTheMiddle.kt")
public void testAnotherKotlinClassInTheMiddle() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/anotherKotlinClassInTheMiddle.kt");
}
@Test
@TestMetadata("diamond.kt")
public void testDiamond() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/diamond.kt");
}
@Test
@TestMetadata("double.kt")
public void testDouble() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/double.kt");
}
@Test
@TestMetadata("generic.kt")
public void testGeneric() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/generic.kt");
}
@Test
@TestMetadata("int.kt")
public void testInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/int.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/nullableInt.kt");
}
}
}
@Nested
@@ -31304,6 +31304,52 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
runTest("compiler/testData/codegen/box/javaInterop/objectMethods/cloneableClassWithoutClone.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("anotherKotlinClassInTheMiddle.kt")
public void testAnotherKotlinClassInTheMiddle() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/anotherKotlinClassInTheMiddle.kt");
}
@Test
@TestMetadata("diamond.kt")
public void testDiamond() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/diamond.kt");
}
@Test
@TestMetadata("double.kt")
public void testDouble() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/double.kt");
}
@Test
@TestMetadata("generic.kt")
public void testGeneric() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/generic.kt");
}
@Test
@TestMetadata("int.kt")
public void testInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/int.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/nullableInt.kt");
}
}
}
@Nested
@@ -26541,6 +26541,49 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/javaInterop/objectMethods/cloneableClassWithoutClone.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class PrimitiveVsWrapperTypeInInheritance extends AbstractLightAnalysisModeTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("anotherKotlinClassInTheMiddle.kt")
public void testAnotherKotlinClassInTheMiddle() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/anotherKotlinClassInTheMiddle.kt");
}
@TestMetadata("diamond.kt")
public void testDiamond() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/diamond.kt");
}
@TestMetadata("double.kt")
public void testDouble() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/double.kt");
}
@TestMetadata("generic.kt")
public void testGeneric() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/generic.kt");
}
@TestMetadata("int.kt")
public void testInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/int.kt");
}
@TestMetadata("nullableInt.kt")
public void testNullableInt() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/nullableInt.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/box/javaVisibility")
@@ -22910,6 +22910,16 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/objectMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
}
}
@Nested
@@ -22910,6 +22910,16 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/objectMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
}
}
@Nested
@@ -22910,6 +22910,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/objectMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
}
}
@Nested
@@ -22910,6 +22910,16 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/objectMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
}
}
@Nested
@@ -26407,6 +26407,19 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/objectMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
@Tag("frontend-fir")
@FirPipeline()
@UseExtTestCaseGroupProvider()
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
}
@Nested
@@ -26943,6 +26943,21 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/objectMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
@Tag("frontend-fir")
@FirPipeline()
@UseExtTestCaseGroupProvider()
@UsePartialLinkage(mode = Mode.DISABLED)
@Tag("no-partial-linkage-may-be-skipped")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
}
@Nested
@@ -25871,6 +25871,17 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/objectMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
@UseExtTestCaseGroupProvider()
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
}
@Nested
@@ -26408,6 +26408,19 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/objectMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
@UseExtTestCaseGroupProvider()
@UsePartialLinkage(mode = Mode.DISABLED)
@Tag("no-partial-linkage-may-be-skipped")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
}
@Nested
@@ -22898,6 +22898,16 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/objectMethods"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
}
}
@Nested
@@ -22898,6 +22898,16 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/objectMethods"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance")
@TestDataPath("$PROJECT_ROOT")
public class PrimitiveVsWrapperTypeInInheritance {
@Test
public void testAllFilesPresentInPrimitiveVsWrapperTypeInInheritance() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
}
}
@Nested