diff --git a/compiler/testData/codegen/box/inlineClasses/UIntArraySortExample.kt b/compiler/testData/codegen/box/inlineClasses/UIntArraySortExample.kt index bcb6651730e..f6ded54d415 100644 --- a/compiler/testData/codegen/box/inlineClasses/UIntArraySortExample.kt +++ b/compiler/testData/codegen/box/inlineClasses/UIntArraySortExample.kt @@ -1,7 +1,8 @@ // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(private val value: Int) : Comparable { companion object { private const val INT_MASK = 0xffffffffL @@ -22,7 +23,8 @@ value class UInt(private val value: Int) : Comparable { value xor Int.MIN_VALUE } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UIntArray(private val intArray: IntArray) { val size: Int get() = intArray.size @@ -35,7 +37,8 @@ value class UIntArray(private val intArray: IntArray) { operator fun iterator(): UIntIterator = UIntIterator(intArray.iterator()) } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UIntIterator(private val intIterator: IntIterator) : Iterator { override fun next(): UInt { return UInt(intIterator.next()) diff --git a/compiler/testData/codegen/box/inlineClasses/annotatedMemberExtensionProperty.kt b/compiler/testData/codegen/box/inlineClasses/annotatedMemberExtensionProperty.kt index 18d6c9ca286..4b1938371ee 100644 --- a/compiler/testData/codegen/box/inlineClasses/annotatedMemberExtensionProperty.kt +++ b/compiler/testData/codegen/box/inlineClasses/annotatedMemberExtensionProperty.kt @@ -3,7 +3,8 @@ @Target(AnnotationTarget.PROPERTY) annotation class Anno -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val s: String) class A { diff --git a/compiler/testData/codegen/box/inlineClasses/anySuperCall.kt b/compiler/testData/codegen/box/inlineClasses/anySuperCall.kt index b2a57039433..a205d48d2dc 100644 --- a/compiler/testData/codegen/box/inlineClasses/anySuperCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/anySuperCall.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME // IGNORE_BACKEND: JVM -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: Int) { fun f(): Int = super.hashCode() } diff --git a/compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt b/compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt index 3adb247bf69..07103a06eab 100644 --- a/compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt +++ b/compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt @@ -1,21 +1,25 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcInt(val i: Int) { fun simple(): String = i.toString() } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcLong(val l: Long) { fun simple(): String = l.toString() } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcAny(val a: Any?) { fun simple(): String = a?.toString() ?: "null" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcOverIc(val o: IcLong) { fun simple(): String = o.toString() } diff --git a/compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInSecondaryConstructor.kt b/compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInSecondaryConstructor.kt index a26d10f0cb9..b21f11e86bf 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInSecondaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInSecondaryConstructor.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC private constructor(val i: Int) { @Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_INLINE_CLASS") constructor() : this(0) { diff --git a/compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInitBlock.kt b/compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInitBlock.kt index c0c77e82a27..9265744949e 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInitBlock.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInitBlock.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val i: Int) { init { counter += i diff --git a/compiler/testData/codegen/box/inlineClasses/boxNullableForFakeOverride.kt b/compiler/testData/codegen/box/inlineClasses/boxNullableForFakeOverride.kt index 3125f7ec80b..43e05fa36c9 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxNullableForFakeOverride.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxNullableForFakeOverride.kt @@ -4,7 +4,8 @@ abstract class C { fun foo(v: T?, x: (T) -> Any?) = v?.let { x(it) } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class V(val value: Any?) class D : C() diff --git a/compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt b/compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt index 92254be3900..8d35f51fe1a 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt @@ -6,13 +6,16 @@ class BoxFoo(val boxed: IFoo?) interface IFoo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str(val value: String) : IFoo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str2(val value: Str): IFoo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class StrArr(val value: Array): IFoo fun boxToTypeParameter(x: Str?) = BoxT(x) diff --git a/compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt b/compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt index 2a802d4ef7a..e67d29a9327 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt @@ -6,7 +6,8 @@ class BoxFoo(val boxed: IFoo?) interface IFoo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class I32(val value: Int): IFoo fun boxToTypeParameter(x: I32?) = BoxT(x) diff --git a/compiler/testData/codegen/box/inlineClasses/boxResultInlineClassOfConstructorCall.kt b/compiler/testData/codegen/box/inlineClasses/boxResultInlineClassOfConstructorCall.kt index d8ca457fd99..3833840792c 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxResultInlineClassOfConstructorCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxResultInlineClassOfConstructorCall.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Result(val a: Any?) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxAny.kt index b967b38ada8..dd634a1446b 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any) fun useX(x: X): String = x.x as String diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxFunLiteralAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxFunLiteralAny.kt index e3ac9d3804f..c42ebf33c20 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxFunLiteralAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxFunLiteralAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any) fun useX(x: X): String = x.x as String diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxInt.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxInt.kt index 72fea215034..8ca6a439023 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxInt.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxInt.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Int) fun useX(x: X): String = if (x.x == 42) "OK" else "fail: $x" diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAny.kt index f232609c279..d2a5ebf109c 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any?) fun useX(x: X): String = x.x as String diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAnyNull.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAnyNull.kt index 36a212f35ff..e98f0631a54 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAnyNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAnyNull.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any?) fun useX(x: X): String = if (x.x == null) "OK" else "fail: $x" diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableInt.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableInt.kt index 3136126f4a9..6b7f7824322 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableInt.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableInt.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Int?) fun useX(x: X): String = if (x.x == 42) "OK" else "fail: $x" diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableIntNull.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableIntNull.kt index 037cda88445..1ff824c978a 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableIntNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableIntNull.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Int?) fun useX(x: X): String = if (x.x == null) "OK" else "fail: $x" diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableString.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableString.kt index 0f0b1ee325c..d3a3be3447e 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableString.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableString.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: String?) fun useX(x: X): String = x.x ?: "fail: $x" diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableStringNull.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableStringNull.kt index d137ff36972..e1a64f4da12 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableStringNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableStringNull.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: String?) fun useX(x: X): String = if (x.x == null) "OK" else "fail: $x" diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxString.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxString.kt index 8794b994979..687ec0dbe71 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxString.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxString.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: String) fun useX(x: X): String = x.x diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/boxReturnValueInDefaultMethod.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/boxReturnValueInDefaultMethod.kt index 7c69e70a15f..da144d81b53 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/boxReturnValueInDefaultMethod.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/boxReturnValueInDefaultMethod.kt @@ -6,7 +6,8 @@ interface X { fun next(): T = this + 1 } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val value: Int) : X { override operator fun plus(n: Int) = A(value + n) } diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideChainErasedToAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideChainErasedToAny.kt index 5f75f61e50c..729e47fc3c1 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideChainErasedToAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideChainErasedToAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any) interface IBar { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideChainErasedToNullableAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideChainErasedToNullableAny.kt index bf852bdf188..dc58ca2e816 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideChainErasedToNullableAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideChainErasedToNullableAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any?) interface IBar { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToAny.kt index 44f6030dd81..def3e49e07f 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToInterface.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToInterface.kt index d2212057d63..b3ef5674f47 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToInterface.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToInterface.kt @@ -4,7 +4,8 @@ interface IFoo { fun foo(): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ICFoo(val t: IFoo): IFoo { override fun foo(): String = t.foo() } diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToPrimitive.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToPrimitive.kt index 96802f42831..1f740ad70d9 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToPrimitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToPrimitive.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Char) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideListVsMutableList.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideListVsMutableList.kt index 61a503e746d..6631f995dc7 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideListVsMutableList.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideListVsMutableList.kt @@ -8,7 +8,8 @@ interface IFooMutableList { fun foo(): MutableList } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class AL(val t: MutableList) : MutableList { override val size: Int get() = t.size override fun get(index: Int): String = t.get(index) diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideUnrelatedInterfaces.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideUnrelatedInterfaces.kt index a2e9eb202a9..a96bc48d08f 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideUnrelatedInterfaces.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideUnrelatedInterfaces.kt @@ -3,7 +3,8 @@ interface IQ1 interface IQ2 -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any): IQ1, IQ2 interface IFoo1 { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverride.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverride.kt index 548bfeb58bf..48a8b0e5ec5 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverride.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverride.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverrideSpecialized.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverrideSpecialized.kt index e8b1b99f7a2..6a9cbb08e31 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverrideSpecialized.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverrideSpecialized.kt @@ -10,7 +10,8 @@ interface IBar { interface SFooBar : GFoo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: String) : IBar { override fun bar(): String = x } diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/inlineClassInOverriddenReturnTypes.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/inlineClassInOverriddenReturnTypes.kt index 1a6f837ec16..3f9efe17a99 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/inlineClassInOverriddenReturnTypes.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/inlineClassInOverriddenReturnTypes.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: String) interface IFoo1 { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt28483.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt28483.kt index 52e86e16050..148d825d6db 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt28483.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt28483.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ResultOrClosed(val x: Any?) interface A { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt31585.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt31585.kt index 4c9f236b5aa..377719cadde 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt31585.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt31585.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class FieldValue(val value: String) enum class RequestFields { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt35234.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt35234.kt index c23592ef3b3..f2893a31aa5 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt35234.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt35234.kt @@ -2,7 +2,8 @@ // WASM_MUTE_REASON: STDLIB_TEXT // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class NumberInlineClass(val value: Double) interface TypeAdapter { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt35234a.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt35234a.kt index 4fd03e84668..ca6c46e9cc7 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt35234a.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt35234a.kt @@ -2,7 +2,8 @@ // WASM_MUTE_REASON: STDLIB_TEXT // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class NumberInlineClass(val value: Double) interface TypeAdapter { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithInlineClass.kt index 4f6e6f466cb..f2c25840f80 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithInlineClass.kt @@ -1,13 +1,15 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Marker(val i: Int) interface I { fun foo(i: Marker) : T } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val a: Any) class C : I { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullAny.kt index 589dc7adb82..4af54f2e734 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAny.kt index c08a65ed2a9..097ef6aadb0 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any?) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAnyNull.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAnyNull.kt index 3abef95e819..cb5d2324a90 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAnyNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAnyNull.kt @@ -2,7 +2,8 @@ // WITH_RUNTIME // IGNORE_BACKEND: JS_IR_ES6 -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any?) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullAny.kt index 835c20d5712..d5a965cc449 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAny.kt index 96946e561e3..e6a7740ecf1 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any?) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAnyNull.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAnyNull.kt index 77f82ef004a..5a7ccd1e01d 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAnyNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAnyNull.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any?) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes1a.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes1a.kt index 6b8d7fd2a84..cf77c4ed8a9 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes1a.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes1a.kt @@ -4,7 +4,8 @@ interface IQ { fun ok(): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val t: IQ): IQ { override fun ok(): String = t.ok() } diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes1b.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes1b.kt index 60928b23276..7059dede3e0 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes1b.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes1b.kt @@ -4,7 +4,8 @@ interface IQ { fun ok(): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val t: IQ): IQ { override fun ok(): String = t.ok() } diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes2a.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes2a.kt index a380083f115..25db05029f8 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes2a.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes2a.kt @@ -6,7 +6,8 @@ interface IQ : IBase { fun ok(): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val t: IQ): IQ { override fun ok(): String = t.ok() } diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes2b.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes2b.kt index 658f3137ce4..7283864899c 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes2b.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes2b.kt @@ -6,7 +6,8 @@ interface IQ : IBase { fun ok(): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val t: IQ): IQ { override fun ok(): String = t.ok() } diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/uncastInlineClassToAnyAndBack.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/uncastInlineClassToAnyAndBack.kt index 25f3bc083dc..4cbc50a4386 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/uncastInlineClassToAnyAndBack.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/uncastInlineClassToAnyAndBack.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: Any) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/unrelatedGenerics.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/unrelatedGenerics.kt index a63e2474f39..f0cdd767530 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/unrelatedGenerics.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/unrelatedGenerics.kt @@ -8,7 +8,8 @@ interface IFoo2 { fun foo(): T } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: String) class Test : IFoo1, IFoo2 { diff --git a/compiler/testData/codegen/box/inlineClasses/boxUnboxInlineClassesWithOperatorsGetSet.kt b/compiler/testData/codegen/box/inlineClasses/boxUnboxInlineClassesWithOperatorsGetSet.kt index 1b2c612d4df..1e9d6eaccc6 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxUnboxInlineClassesWithOperatorsGetSet.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxUnboxInlineClassesWithOperatorsGetSet.kt @@ -1,11 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(private val value: Int) { fun asInt() = value } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UIntArray(private val intArray: IntArray) { operator fun get(index: Int): UInt = UInt(intArray[index]) diff --git a/compiler/testData/codegen/box/inlineClasses/boxUnboxOfInlineClassForCapturedVars.kt b/compiler/testData/codegen/box/inlineClasses/boxUnboxOfInlineClassForCapturedVars.kt index f1ca1fe47ef..7691384a477 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxUnboxOfInlineClassForCapturedVars.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxUnboxOfInlineClassForCapturedVars.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(private val value: Int) { operator fun plus(other: UInt): UInt = UInt(value + other.asValue()) diff --git a/compiler/testData/codegen/box/inlineClasses/bridgeForFunctionReturningInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/bridgeForFunctionReturningInlineClass.kt index bf71d9f104c..f117aaa055b 100644 --- a/compiler/testData/codegen/box/inlineClasses/bridgeForFunctionReturningInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/bridgeForFunctionReturningInlineClass.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val x: String) interface I { diff --git a/compiler/testData/codegen/box/inlineClasses/bridgeGenerationWithInlineClassOverAny.kt b/compiler/testData/codegen/box/inlineClasses/bridgeGenerationWithInlineClassOverAny.kt index bb2130af164..70f3e426341 100644 --- a/compiler/testData/codegen/box/inlineClasses/bridgeGenerationWithInlineClassOverAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/bridgeGenerationWithInlineClassOverAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Result(val a: Any?) { fun getOrThrow(): T = a as T } diff --git a/compiler/testData/codegen/box/inlineClasses/bridgesWhenInlineClassImplementsGenericInterface.kt b/compiler/testData/codegen/box/inlineClasses/bridgesWhenInlineClassImplementsGenericInterface.kt index d2bf80f7ac7..633adf1f603 100644 --- a/compiler/testData/codegen/box/inlineClasses/bridgesWhenInlineClassImplementsGenericInterface.kt +++ b/compiler/testData/codegen/box/inlineClasses/bridgesWhenInlineClassImplementsGenericInterface.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlinedComparable(val x: Int) : Comparable { override fun compareTo(other: InlinedComparable): Int { return x.compareTo(other.x) @@ -13,7 +14,8 @@ interface Base { fun Base.foo(a: Base, b: T): Base } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlinedBase(val x: Int) : Base { override fun Base.foo(a: Base, b: InlinedBase): Base { return if (a is InlinedBase) InlinedBase(a.x + b.x) else this diff --git a/compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt index c6f3c3df4b6..2026399d13a 100644 --- a/compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Props(val intArray: IntArray) { val size get() = intArray.size diff --git a/compiler/testData/codegen/box/inlineClasses/callSpecializedEqualsViaReflection.kt b/compiler/testData/codegen/box/inlineClasses/callSpecializedEqualsViaReflection.kt index e9901b09e66..64bc2780557 100644 --- a/compiler/testData/codegen/box/inlineClasses/callSpecializedEqualsViaReflection.kt +++ b/compiler/testData/codegen/box/inlineClasses/callSpecializedEqualsViaReflection.kt @@ -6,7 +6,8 @@ import java.lang.reflect.InvocationTargetException -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Simple(val x: String) { fun somethingWeird() {} } diff --git a/compiler/testData/codegen/box/inlineClasses/callSpeciallyOverriddenPropertyOfInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/callSpeciallyOverriddenPropertyOfInlineClass.kt index 1491016d7de..8aee9434530 100644 --- a/compiler/testData/codegen/box/inlineClasses/callSpeciallyOverriddenPropertyOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/callSpeciallyOverriddenPropertyOfInlineClass.kt @@ -1,10 +1,12 @@ // WITH_RUNTIME // TARGET_BACKEND: JVM -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UIntArray(private val storage: IntArray) : Collection { public override val size: Int get() = storage.size diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt index 79dd9f5455f..d7ca1c56789 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt @@ -1,10 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) fun Z.test() = x diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt index 06de9b0d5b6..212fe8c3932 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt @@ -1,10 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) val Z.xx get() = x diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt index f3b4714f714..ca4053fb7a4 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt @@ -1,16 +1,19 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) { fun test() = x } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) { fun test() = x } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) { fun test() = x } diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt index 65d3e00809c..5e0cf9dca93 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt @@ -1,16 +1,19 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) { val xx get() = x } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) { val xx get() = x } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) { val xx get() = x } diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt index f2f4f837a4f..2fd1b8dd155 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt @@ -1,10 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/constructorWithInlineClassParameters.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/constructorWithInlineClassParameters.kt index 89245836b2d..5a7a8314bf5 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/constructorWithInlineClassParameters.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/constructorWithInlineClassParameters.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME import kotlin.test.assertEquals -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) class Outer(val z1: Z) { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/equalsHashCodeToString.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/equalsHashCodeToString.kt index 67f74830238..7a87b81200d 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/equalsHashCodeToString.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/equalsHashCodeToString.kt @@ -6,7 +6,8 @@ import kotlin.test.* -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val s: String) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt index 7e5f60c84f8..f16793fdda3 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt @@ -1,10 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) fun test(aZ: Z, aL: L, aS: S) = "${aZ.x} ${aL.x} ${aS.x}" diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt index f7212f30173..44fe012d273 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt @@ -1,10 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) fun Z.test() = x diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt index 4c432d86636..fc486adf987 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt @@ -1,10 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) val Z.xx get() = x diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt index 44446c8a5bb..794adadea85 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt @@ -1,11 +1,14 @@ // WITH_RUNTIME import kotlin.test.assertEquals -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(internal val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(internal val x: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(internal val x: String) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt index 75fec558530..c3bdb6b6221 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt @@ -1,16 +1,19 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) { fun test() = x } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) { fun test() = x } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) { fun test() = x } diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt index b92b57532db..074d452cfc1 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt @@ -1,16 +1,19 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) { val xx get() = x } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) { val xx get() = x } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) { val xx get() = x } diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt index cf068028b04..f068cd90542 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt @@ -1,10 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt index d085dec55da..9aaf919002a 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt @@ -1,10 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt index 299eaec6982..6a6852fe056 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt @@ -1,21 +1,24 @@ // WITH_RUNTIME import kotlin.test.assertEquals -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(private val x: Int) { companion object { val xref = Z::x } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(private val x: Long) { companion object { val xref = L::x } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(private val x: String) { companion object { val xref = S::x diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt index 6c29a3882f0..ac1e55ab403 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt @@ -1,5 +1,6 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) class C(var z: Z) diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt index 50b0dab835d..2b536f355b1 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt @@ -1,5 +1,6 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) class C(var z: Z) diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt index 18b34532736..1f35ba48645 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt @@ -1,5 +1,6 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) var topLevel = Z(42) diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/kt37986.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/kt37986.kt index 187b6cdd70e..e32c150badf 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/kt37986.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/kt37986.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(val x: Any) fun useR(r: R) { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/any.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/any.kt index 02f0bfe1551..494dd53c8b3 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/any.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/any.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Value(val value: Any) object Foo { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/anyN.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/anyN.kt index 6b3f84244e1..2c257104804 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/anyN.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/anyN.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Value(val value: Any?) object Foo { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/int.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/int.kt index cf749872bf0..e68d366adbc 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/int.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/int.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Value(val value: Int) object Foo { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/intN.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/intN.kt index 4a595be4d3a..f4cfa60d826 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/intN.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/intN.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Value(val value: Int?) object Foo { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/null.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/null.kt index 67913c2c4e0..b7c65f726e1 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/null.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/null.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Value(val value: Any) fun foo(value: Value?) = value?.value as String? diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/string.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/string.kt index 587fda30ed5..47c2bb8d885 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/string.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/string.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Value(val value: String) object Foo { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/stringN.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/stringN.kt index bcfe308cc39..c139cc4f7c7 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/stringN.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/stringN.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Value(val value: String?) object Foo { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferencesWithInlineClasses.kt b/compiler/testData/codegen/box/inlineClasses/callableReferencesWithInlineClasses.kt index f96dadce614..54af0d57d67 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferencesWithInlineClasses.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferencesWithInlineClasses.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME // WITH_REFLECT -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val x: String) { fun bar(f: Foo, i: Int): Foo = Foo(x + f.x + i) } diff --git a/compiler/testData/codegen/box/inlineClasses/castInsideWhenExpression.kt b/compiler/testData/codegen/box/inlineClasses/castInsideWhenExpression.kt index bdeb7a95f75..14026af573e 100644 --- a/compiler/testData/codegen/box/inlineClasses/castInsideWhenExpression.kt +++ b/compiler/testData/codegen/box/inlineClasses/castInsideWhenExpression.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val x: Any) { fun bar() {} } diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxUnboxOfArgumentsOnInlinedFunctions.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxUnboxOfArgumentsOnInlinedFunctions.kt index 0c6733c011e..562cabb11ce 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxUnboxOfArgumentsOnInlinedFunctions.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxUnboxOfArgumentsOnInlinedFunctions.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val value: Int) fun id(x: T): T = x diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxingAfterAssertionOperator.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxingAfterAssertionOperator.kt index f65e243a7d3..91e637ec40f 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxingAfterAssertionOperator.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxingAfterAssertionOperator.kt @@ -1,14 +1,17 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class WithPrimitive(val a: Int) fun takeWithPrimitive(a: WithPrimitive) {} -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class WithReference(val a: Any) fun takeWithReference(a: WithReference) {} -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class WithNullableReference(val a: Any?) fun takeWithNullableReference(a: WithNullableReference) {} diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxingForComplexClassHierarchy.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxingForComplexClassHierarchy.kt index 757aca76086..e684dd817b5 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxingForComplexClassHierarchy.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxingForComplexClassHierarchy.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val x: Int) interface I { diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxingForNonLocalAndLabeledReturns.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxingForNonLocalAndLabeledReturns.kt index 9b1f98131b6..185ae627a75 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxingForNonLocalAndLabeledReturns.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxingForNonLocalAndLabeledReturns.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ULong(val l: Long) fun nonLocal(): ULong? { diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxingFromReturnTypeForInlineClasses.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxingFromReturnTypeForInlineClasses.kt index c44966bce58..b117e1b27ac 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxingFromReturnTypeForInlineClasses.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxingFromReturnTypeForInlineClasses.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val a: Int) { fun member(): String = "" diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxingOnFunctionCalls.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxingOnFunctionCalls.kt index e2d01a2d8e2..434b1b99cc4 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxingOnFunctionCalls.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxingOnFunctionCalls.kt @@ -1,8 +1,10 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineNotNullPrimitive(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineNotNullReference(val y: String) fun testNotNullPrimitive(a: Any, b: T, c: InlineNotNullPrimitive, d: InlineNotNullPrimitive?) {} diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxingOnLocalVariableAssignments.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxingOnLocalVariableAssignments.kt index 7c72f8d892b..24ef986759f 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxingOnLocalVariableAssignments.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxingOnLocalVariableAssignments.kt @@ -1,12 +1,16 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineNotNullPrimitive(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineNullablePrimitive(val x: Int?) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineNotNullReference(val a: Any) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineNullableReference(val a: Any?) fun test1(a: InlineNotNullPrimitive) { diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxingUnboxingForInheritedTypeSpecializedFunctions.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxingUnboxingForInheritedTypeSpecializedFunctions.kt index a5cbb757915..ad5890d4e7b 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxingUnboxingForInheritedTypeSpecializedFunctions.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxingUnboxingForInheritedTypeSpecializedFunctions.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val x: Int) abstract class A { diff --git a/compiler/testData/codegen/box/inlineClasses/checkCallingMembersInsideInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/checkCallingMembersInsideInlineClass.kt index 05d4e6d78a4..bdefd42dea9 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkCallingMembersInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkCallingMembersInsideInlineClass.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val x: Int) { fun empty() = "" fun withParam(a: String) = a diff --git a/compiler/testData/codegen/box/inlineClasses/checkCastToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/checkCastToInlineClass.kt index 18e3d0b8ea9..48e2e60ff28 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkCastToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkCastToInlineClass.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(val s: Int) fun test(a1: Any, a2: UInt?, a3: Any?, a4: Any?): Int { diff --git a/compiler/testData/codegen/box/inlineClasses/checkForInstanceOfInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/checkForInstanceOfInlineClass.kt index 1b029ae824a..99a6c5e7871 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkForInstanceOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkForInstanceOfInlineClass.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(val u: Int) { override fun toString(): String { return "UInt: $u" diff --git a/compiler/testData/codegen/box/inlineClasses/checkLambdaWithInlineClassesInFunctionalType.kt b/compiler/testData/codegen/box/inlineClasses/checkLambdaWithInlineClassesInFunctionalType.kt index edc43be303c..c141f1cc5f3 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkLambdaWithInlineClassesInFunctionalType.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkLambdaWithInlineClassesInFunctionalType.kt @@ -1,8 +1,10 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(val value: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ULong(val value: Long) fun foo(u: UInt, f: (UInt) -> ULong): ULong = f(u) diff --git a/compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt b/compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt index d8499038d44..1c89b50fa4a 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Result(val a: Any?) { fun typed(): T = a as T } diff --git a/compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt b/compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt index a5043e824ef..467b0bca310 100644 --- a/compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt +++ b/compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt @@ -2,7 +2,8 @@ var result = "Fail" -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val value: String) { init { class B { diff --git a/compiler/testData/codegen/box/inlineClasses/classLiteralOnInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/classLiteralOnInlineClass.kt index 1dad200a5e7..eb317793253 100644 --- a/compiler/testData/codegen/box/inlineClasses/classLiteralOnInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/classLiteralOnInlineClass.kt @@ -6,13 +6,17 @@ package root import kotlin.reflect.KClass -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcInt(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcLong(val l: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcAny(val a: Any?) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcOverIc(val o: IcLong) fun check(c: KClass<*>, s: String) { diff --git a/compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt index 18d32d0864c..257a6f9983c 100644 --- a/compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UIntArray(private val intArray: IntArray) { val size get() = intArray.size } diff --git a/compiler/testData/codegen/box/inlineClasses/conformToComparableAndCallInterfaceMethod.kt b/compiler/testData/codegen/box/inlineClasses/conformToComparableAndCallInterfaceMethod.kt index 1489d5c6f90..9e4cf583c47 100644 --- a/compiler/testData/codegen/box/inlineClasses/conformToComparableAndCallInterfaceMethod.kt +++ b/compiler/testData/codegen/box/inlineClasses/conformToComparableAndCallInterfaceMethod.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val x: Int) : Comparable { override fun compareTo(other: Foo): Int { return 10 diff --git a/compiler/testData/codegen/box/inlineClasses/constructorCallableReference.kt b/compiler/testData/codegen/box/inlineClasses/constructorCallableReference.kt index fc31f92c6f7..3049ea84fbe 100644 --- a/compiler/testData/codegen/box/inlineClasses/constructorCallableReference.kt +++ b/compiler/testData/codegen/box/inlineClasses/constructorCallableReference.kt @@ -9,7 +9,8 @@ interface I { } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val ok: String = "OK") : I fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/constructorImplVisibility.kt b/compiler/testData/codegen/box/inlineClasses/constructorImplVisibility.kt index 14bc88ccbd7..ab154ca0291 100644 --- a/compiler/testData/codegen/box/inlineClasses/constructorImplVisibility.kt +++ b/compiler/testData/codegen/box/inlineClasses/constructorImplVisibility.kt @@ -4,13 +4,17 @@ import java.lang.reflect.Modifier -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC1 public constructor(val i: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC11 internal constructor(val i: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC2 private constructor(val i: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC4 protected constructor(val i: Int) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod.kt index 3172859f6bb..c12d5db4f98 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { fun test() = ok() diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod2.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod2.kt index 5fa9824a5cd..086b2e15866 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod2.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod2.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Long) { fun test() = ok() diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromCompanion.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromCompanion.kt index 385ce90b0d4..8cabf7ff191 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromCompanion.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromCompanion.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Composed(val s: String) { private constructor(s1: String, s2: String) : this(s1 + s2) diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromLambda.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromLambda.kt index 43d8b6bb6d2..ce91dbb302a 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromLambda.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromLambda.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Composed(val s: String) { constructor(s: String, x: Int) : this(s.subSequence(0, x).toString()) diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromCompanion.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromCompanion.kt index 7581f48915c..ffd993c2e10 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromCompanion.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromCompanion.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { private fun ok() = "OK" diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromCompanion2.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromCompanion2.kt index d88b281c241..e10ec4e98a1 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromCompanion2.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromCompanion2.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Long) { private fun ok() = "OK" diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda.kt index 150fd9a2364..677b1b6ceca 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { fun test() = run { ok() } diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda2.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda2.kt index 8dde0f73160..ae8234f782c 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda2.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda2.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Long) { fun test() = run { ok() } diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda.kt index a53cc2adac0..50b335cdcdf 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda.kt @@ -2,7 +2,8 @@ fun eval(fn: () -> T) = fn() -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { fun test() = eval { ok() } diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda2.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda2.kt index ed61bc4bb59..01c52902e1e 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda2.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda2.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Long) { fun test() = { ok() }() diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateStaticInlineClassCompanionMethod.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateStaticInlineClassCompanionMethod.kt index d1c1357684f..21a4b5bf8c4 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateStaticInlineClassCompanionMethod.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateStaticInlineClassCompanionMethod.kt @@ -1,7 +1,8 @@ // TARGET_BACKEND: JVM // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { fun test() = ok() diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda.kt index 35f93d4c1d9..10c51eb5164 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { fun test() = { ok() }() diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda2.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda2.kt index 6672980c62e..1d3bdb2d20c 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda2.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda2.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Long) { fun test() = { ok() }() diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInObject.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInObject.kt index 61be68ba299..48a16381315 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInObject.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInObject.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { fun test() = object { override fun toString() = ok() diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/inlineLambdaInInlineClassFun.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/inlineLambdaInInlineClassFun.kt index 1c2e5cc684a..ef5bb3fff8e 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/inlineLambdaInInlineClassFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/inlineLambdaInInlineClassFun.kt @@ -2,7 +2,8 @@ inline fun runInline(fn: () -> String) = fn() -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { fun test() = runInline { "OK" } } diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt26858.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt26858.kt index a0abcbc45f5..6127ada57e2 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt26858.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt26858.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Direction(private val direction: Int) { fun dx() = dx[direction] fun dy() = dy[direction] diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt27513.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt27513.kt index 52524f314ea..21e6948af88 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt27513.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt27513.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val b: String) { override fun toString(): String = buildString { append(b) } diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt30780.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt30780.kt index fbd3140468c..7a3301bb8a9 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt30780.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt30780.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Test(val x: Int) { private companion object { private const val CONSTANT = "OK" diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/lambdaInInlineClassFun.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/lambdaInInlineClassFun.kt index 676bbf3ecf7..6265d51b30b 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/lambdaInInlineClassFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/lambdaInInlineClassFun.kt @@ -2,7 +2,8 @@ fun eval(fn: () -> T) = fn() -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { fun test() = eval { "OK" } } diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/objectInInlineClassFun.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/objectInInlineClassFun.kt index 79b426f8f1e..5c332e74f35 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/objectInInlineClassFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/objectInInlineClassFun.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { fun test() = object { diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionFun.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionFun.kt index 8222cdbe4fe..0f55c18adb9 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionFun.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { fun test() = pf() diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionVal.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionVal.kt index a4b72f17bda..60102d6675d 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionVal.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { fun test() = pv diff --git a/compiler/testData/codegen/box/inlineClasses/correctBoxingForBranchExpressions.kt b/compiler/testData/codegen/box/inlineClasses/correctBoxingForBranchExpressions.kt index 6aa1c55ef58..b02d35b9111 100644 --- a/compiler/testData/codegen/box/inlineClasses/correctBoxingForBranchExpressions.kt +++ b/compiler/testData/codegen/box/inlineClasses/correctBoxingForBranchExpressions.kt @@ -4,7 +4,8 @@ interface Base { fun result(): Int } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Inlined(val x: Int) : Base { override fun result(): Int = x } diff --git a/compiler/testData/codegen/box/inlineClasses/createInlineClassInArgumentPosition.kt b/compiler/testData/codegen/box/inlineClasses/createInlineClassInArgumentPosition.kt index 68b7974571b..442df14ca98 100644 --- a/compiler/testData/codegen/box/inlineClasses/createInlineClassInArgumentPosition.kt +++ b/compiler/testData/codegen/box/inlineClasses/createInlineClassInArgumentPosition.kt @@ -1,13 +1,15 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class AsInt(val value: Int) { override fun toString(): String { return "asInt: ${value.toString()}" } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class AsAny(val value: Any) { override fun toString(): String { return "asAny: ${value.toString()}" diff --git a/compiler/testData/codegen/box/inlineClasses/crossinlineWithInlineClassInParameter.kt b/compiler/testData/codegen/box/inlineClasses/crossinlineWithInlineClassInParameter.kt index 81925b14d31..fd5d7f8bcaa 100644 --- a/compiler/testData/codegen/box/inlineClasses/crossinlineWithInlineClassInParameter.kt +++ b/compiler/testData/codegen/box/inlineClasses/crossinlineWithInlineClassInParameter.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Result(val a: Any?) { fun getOrThrow(): T = a as T } diff --git a/compiler/testData/codegen/box/inlineClasses/customIterator.kt b/compiler/testData/codegen/box/inlineClasses/customIterator.kt index ebac705117d..65457d14e3c 100644 --- a/compiler/testData/codegen/box/inlineClasses/customIterator.kt +++ b/compiler/testData/codegen/box/inlineClasses/customIterator.kt @@ -4,7 +4,8 @@ // WITH_RUNTIME // KT-44529 -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineDouble3(val values: DoubleArray) { operator fun iterator(): DoubleIterator = IteratorImpl(values) } diff --git a/compiler/testData/codegen/box/inlineClasses/defaultFunctionsFromAnyForInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/defaultFunctionsFromAnyForInlineClass.kt index c9265608952..c9c05bec8b4 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultFunctionsFromAnyForInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultFunctionsFromAnyForInlineClass.kt @@ -1,12 +1,16 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class FooRef(val y: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class FooLong(val x: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class FooDouble(val y: Double) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/defaultInterfaceMethodsInInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/defaultInterfaceMethodsInInlineClass.kt index 92410183a36..30552d5f26d 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultInterfaceMethodsInInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultInterfaceMethodsInInlineClass.kt @@ -5,7 +5,8 @@ interface IFoo { fun T.bar(): String = "K" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) : IFoo fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultConstructorParameterValuesOfInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultConstructorParameterValuesOfInlineClassType.kt index df9b430bd84..794c1e906a6 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultConstructorParameterValuesOfInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultConstructorParameterValuesOfInlineClassType.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val z: Int) class Test(val z: Z = Z(42)) { diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultInterfaceFunParameterValuesOfInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultInterfaceFunParameterValuesOfInlineClassType.kt index ad01c65b738..a59649cace5 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultInterfaceFunParameterValuesOfInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultInterfaceFunParameterValuesOfInlineClassType.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val z: Int) interface ITest { diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultParameterValuesOfInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultParameterValuesOfInlineClassType.kt index 1e855e06d44..5fe79e4a1f8 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultParameterValuesOfInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultParameterValuesOfInlineClassType.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val z: Int) fun test(z: Z = Z(42)) = z.z diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultParameterValuesOfInlineClassTypeBoxing.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultParameterValuesOfInlineClassTypeBoxing.kt index ef556a58f1b..e67118cfd28 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultParameterValuesOfInlineClassTypeBoxing.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultParameterValuesOfInlineClassTypeBoxing.kt @@ -4,7 +4,8 @@ interface IFoo { fun foo(): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val z: Int) : IFoo { override fun foo() = z.toString() } diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultValueOfInlineClassTypeInInlineFun.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultValueOfInlineClassTypeInInlineFun.kt index fe2e597ee7b..856710f27f9 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultValueOfInlineClassTypeInInlineFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultValueOfInlineClassTypeInInlineFun.kt @@ -1,12 +1,16 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val int: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val long: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str(val string: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Obj(val obj: Any) inline fun withDefaultZ(fn: (Z) -> R, x: Z = Z(42)) = fn(x) diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultValueOfInlineClassTypeInInlineFunInInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultValueOfInlineClassTypeInInlineFunInInlineClass.kt index 54e83c05bd5..71c31bbbf1d 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultValueOfInlineClassTypeInInlineFunInInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultValueOfInlineClassTypeInInlineFunInInlineClass.kt @@ -1,15 +1,20 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val int: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val long: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str(val string: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Obj(val obj: Any) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Host(val xx: Int) { inline fun withDefaultZ(fn: (Z) -> R, x: Z = Z(xx)) = fn(x) inline fun withDefaultL(fn: (L) -> R, x: L = L(xx.toLong())) = fn(x) diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassFun.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassFun.kt index f1a1bea6be3..d8f0e18c910 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassFun.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) { fun test(y: Int = 42) = x + y } diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassPrimaryConstructor.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassPrimaryConstructor.kt index c20961bdb3d..21a4fb26183 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassPrimaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassPrimaryConstructor.kt @@ -1,10 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int = 1234) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long = 1234L) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String = "foobar") fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassPrimaryConstructorWithInlineClassValue.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassPrimaryConstructorWithInlineClassValue.kt index 74c6b1cf478..a783673371d 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassPrimaryConstructorWithInlineClassValue.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassPrimaryConstructorWithInlineClassValue.kt @@ -1,9 +1,11 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Inner(val result: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val inner: Inner = Inner("OK")) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassSecondaryConstructor.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassSecondaryConstructor.kt index 78bb730ef09..148dda0312c 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassSecondaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassSecondaryConstructor.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) { constructor(x: Long = 42L) : this(x.toInt()) } diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt26554.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt26554.kt index 66927075c78..2417f31e17e 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt26554.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt26554.kt @@ -4,7 +4,8 @@ data class RGBA(val rgba: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class RgbaArray(val array: IntArray) { val size: Int get() = array.size diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt index cc93e53f0c4..2a5e6c12fce 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val i: Int) { fun foo(s: String = "OK") = s } diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all-compatibility.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all-compatibility.kt index 7019533e367..078b317c027 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all-compatibility.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all-compatibility.kt @@ -10,7 +10,8 @@ interface Path { fun Int.extension(maxDepth: Int = 42) } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class RealPath(val x: Int) : Path { override fun dispatch(maxDepth: Int) = Unit diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all.kt index c41b06f22dc..7576b879d7f 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all.kt @@ -10,7 +10,8 @@ interface Path { fun Int.extension(maxDepth: Int = 42) } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class RealPath(val x: Int) : Path { override fun dispatch(maxDepth: Int) = Unit diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/compatibility.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/compatibility.kt index 1d75e0d3055..403ed6847ec 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/compatibility.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/compatibility.kt @@ -10,7 +10,8 @@ interface Path { fun Int.extension(maxDepth: Int = 42) } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class RealPath(val x: Int) : Path { override fun dispatch(maxDepth: Int) = Unit diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/default.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/default.kt index 53c2040e5d4..4d16fdc86f4 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/default.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/default.kt @@ -9,7 +9,8 @@ interface Path { fun Int.extension(maxDepth: Int = 42) } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class RealPath(val x: Int) : Path { override fun dispatch(maxDepth: Int) = Unit diff --git a/compiler/testData/codegen/box/inlineClasses/defaultWithInlineClassArgument.kt b/compiler/testData/codegen/box/inlineClasses/defaultWithInlineClassArgument.kt index 32019255cea..159141a0e86 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultWithInlineClassArgument.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultWithInlineClassArgument.kt @@ -3,7 +3,8 @@ fun box() = A(0).f() // FILE: b.kt -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val i: Int) fun A.f(xs: Array = Array(1) { "OK" }) = xs[i] diff --git a/compiler/testData/codegen/box/inlineClasses/elvisWithInlineClassAndNullConstant.kt b/compiler/testData/codegen/box/inlineClasses/elvisWithInlineClassAndNullConstant.kt index 2601c7a70b7..0cd66c016b8 100644 --- a/compiler/testData/codegen/box/inlineClasses/elvisWithInlineClassAndNullConstant.kt +++ b/compiler/testData/codegen/box/inlineClasses/elvisWithInlineClassAndNullConstant.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(private val data: Int) { fun result(): String = if (data == 1) "OK" else "fail" } diff --git a/compiler/testData/codegen/box/inlineClasses/emptyConstructorForInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/emptyConstructorForInlineClass.kt index 85401daa5e6..3d876a47a00 100644 --- a/compiler/testData/codegen/box/inlineClasses/emptyConstructorForInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/emptyConstructorForInlineClass.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val s: String) { fun asResult(): String = s } diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksInlineClassNonNull.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksInlineClassNonNull.kt index 435794342af..d0466ef5b22 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksInlineClassNonNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksInlineClassNonNull.kt @@ -1,8 +1,10 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Inner(val w: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: Inner) fun isNullVacuousLeft(s: A) = s == null diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksMixedNullability.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksMixedNullability.kt index fbf68b2bb86..cc50988d5a7 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksMixedNullability.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksMixedNullability.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val a: String) fun isEqualNA(x: A?, y: A) = x == y diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedInlineClassNonNull.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedInlineClassNonNull.kt index 6f51daeb752..371cd07bfb5 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedInlineClassNonNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedInlineClassNonNull.kt @@ -1,8 +1,10 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Inner(val w: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: Inner) fun isNotNullVacuousLeft(s: A) = s != null diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNonNull.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNonNull.kt index a18131246a3..5859ba65ba4 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNonNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNonNull.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: String) fun isNotNullVacuousLeft(s: A) = s != null diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNullable.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNullable.kt index f39e3717fd3..3ff18d844f6 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNullable.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNullable.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: Any?) fun isNotNullVacuousLeft(s: A) = s != null diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedPrimitive.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedPrimitive.kt index da60312db0d..13fc65422cf 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedPrimitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedPrimitive.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: Int) fun isNotNullVacuousLeft(s: A) = s != null diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksNonNull.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksNonNull.kt index ca95760dd4b..c0efe87a9aa 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksNonNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksNonNull.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: String) fun isNullVacuousLeft(s: A) = s == null diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksNullable.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksNullable.kt index e891d885afb..a9ede8df667 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksNullable.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksNullable.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: Any?) fun isNullVacuousLeft(s: A) = s == null diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksPrimitive.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksPrimitive.kt index 5ed0268c2e0..f84224451e6 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksPrimitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksPrimitive.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: Int) fun isNullVacuousLeft(s: A) = s == null diff --git a/compiler/testData/codegen/box/inlineClasses/equalityForBoxesOfNullableValuesOfInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/equalityForBoxesOfNullableValuesOfInlineClass.kt index 8f400601af4..a80c5ad18cf 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityForBoxesOfNullableValuesOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityForBoxesOfNullableValuesOfInlineClass.kt @@ -1,13 +1,17 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val x: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Y(val y: Number) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class NX(val x: String?) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class NY(val y: Number?) fun testNotNull(x: X?, y: Y?) { diff --git a/compiler/testData/codegen/box/inlineClasses/equalsCallsLeftArgument.kt b/compiler/testData/codegen/box/inlineClasses/equalsCallsLeftArgument.kt index 871570828c3..82d37ba7984 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalsCallsLeftArgument.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalsCallsLeftArgument.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: String) class B { diff --git a/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderInlineClass.kt index 4642c3661a2..4f66ba9afbe 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderInlineClass.kt @@ -1,9 +1,11 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Inner(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: Inner) var i = 0 diff --git a/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderNonNull.kt b/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderNonNull.kt index b74855054cd..1322a7f3cac 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderNonNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderNonNull.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: String = "") var i = 0 diff --git a/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderNullable.kt b/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderNullable.kt index 0c4abf1efd7..7aa675df47c 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderNullable.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderNullable.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: Any? = null) var i = 0 diff --git a/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderPrimitive.kt b/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderPrimitive.kt index 76deb0a3d00..63f7fd7f9de 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderPrimitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderPrimitive.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: Int = 0) var i = 0 diff --git a/compiler/testData/codegen/box/inlineClasses/equalsOperatorWithGenericCall.kt b/compiler/testData/codegen/box/inlineClasses/equalsOperatorWithGenericCall.kt index 46fa2bea3ac..07f8ad962bc 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalsOperatorWithGenericCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalsOperatorWithGenericCall.kt @@ -1,10 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcAny(val x: Any?) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcInt(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcLong(val x: Long) fun id(x: T) = x diff --git a/compiler/testData/codegen/box/inlineClasses/extLambdaInInlineClassFun.kt b/compiler/testData/codegen/box/inlineClasses/extLambdaInInlineClassFun.kt index 23b9de6d596..8ffabc45d85 100644 --- a/compiler/testData/codegen/box/inlineClasses/extLambdaInInlineClassFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/extLambdaInInlineClassFun.kt @@ -2,7 +2,8 @@ fun T.runExt(fn: T.() -> String) = fn() -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { fun test() = runExt { "OK" } } diff --git a/compiler/testData/codegen/box/inlineClasses/extLambdaInInlineClassFun2.kt b/compiler/testData/codegen/box/inlineClasses/extLambdaInInlineClassFun2.kt index c7b18f71808..1039e05ae6c 100644 --- a/compiler/testData/codegen/box/inlineClasses/extLambdaInInlineClassFun2.kt +++ b/compiler/testData/codegen/box/inlineClasses/extLambdaInInlineClassFun2.kt @@ -2,7 +2,8 @@ fun T.runExt(fn: T.() -> String) = fn() -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: String) { fun test() = runExt { r } } diff --git a/compiler/testData/codegen/box/inlineClasses/fieldNameClash.kt b/compiler/testData/codegen/box/inlineClasses/fieldNameClash.kt index 54e6044c78b..2411f7d24eb 100644 --- a/compiler/testData/codegen/box/inlineClasses/fieldNameClash.kt +++ b/compiler/testData/codegen/box/inlineClasses/fieldNameClash.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val s: String) { val Int.s: Int get() = 42 } diff --git a/compiler/testData/codegen/box/inlineClasses/funInterface/argumentIC.kt b/compiler/testData/codegen/box/inlineClasses/funInterface/argumentIC.kt index 7ccc70895c0..2fe0d0f41b8 100644 --- a/compiler/testData/codegen/box/inlineClasses/funInterface/argumentIC.kt +++ b/compiler/testData/codegen/box/inlineClasses/funInterface/argumentIC.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Result(val isSuccess: Boolean) fun interface ResultHandler { diff --git a/compiler/testData/codegen/box/inlineClasses/funInterface/mangledSamWrappers.kt b/compiler/testData/codegen/box/inlineClasses/funInterface/mangledSamWrappers.kt index 45e0b0d5e59..c8e9f5ea392 100644 --- a/compiler/testData/codegen/box/inlineClasses/funInterface/mangledSamWrappers.kt +++ b/compiler/testData/codegen/box/inlineClasses/funInterface/mangledSamWrappers.kt @@ -1,6 +1,7 @@ // IGNORE_BACKEND: JVM // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val value: String) fun interface B { diff --git a/compiler/testData/codegen/box/inlineClasses/funInterface/returnIC.kt b/compiler/testData/codegen/box/inlineClasses/funInterface/returnIC.kt index e5898a5a8ab..55f82f512f9 100644 --- a/compiler/testData/codegen/box/inlineClasses/funInterface/returnIC.kt +++ b/compiler/testData/codegen/box/inlineClasses/funInterface/returnIC.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME // IGNORE_BACKEND: JVM -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Result(val isSuccess: Boolean) fun interface ResultHandler { diff --git a/compiler/testData/codegen/box/inlineClasses/functionExpression.kt b/compiler/testData/codegen/box/inlineClasses/functionExpression.kt index 0860d7ca920..4f2d8acc782 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionExpression.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionExpression.kt @@ -2,7 +2,8 @@ inline fun new(init: (Z) -> Unit): Z = Z(42) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val value: Int) fun box(): String = diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/anonymousObjectInFunctionWithMangledName.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/anonymousObjectInFunctionWithMangledName.kt index 45dbd5dedbd..e4f1745be9d 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/anonymousObjectInFunctionWithMangledName.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/anonymousObjectInFunctionWithMangledName.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) fun foo(s: S): String { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/extensionFunctionsDoNotClash.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/extensionFunctionsDoNotClash.kt index a2e12c61ac8..52ccab240dc 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/extensionFunctionsDoNotClash.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/extensionFunctionsDoNotClash.kt @@ -1,12 +1,15 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Id(val id: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Name(val name: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Password(val password: String) fun Id.test() { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/functionsWithDifferentNullabilityDoNotClash.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/functionsWithDifferentNullabilityDoNotClash.kt index 9ceab7720a3..b28598c1e3d 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/functionsWithDifferentNullabilityDoNotClash.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/functionsWithDifferentNullabilityDoNotClash.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Id(val id: String) fun test(id: Id) { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericFunctionsDoNotClash.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericFunctionsDoNotClash.kt index dbdfba82239..5945593c16f 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericFunctionsDoNotClash.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericFunctionsDoNotClash.kt @@ -1,8 +1,10 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S1(val s1: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S2(val s2: String) object X1 diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericSignatureOfFunctionWithMangledName.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericSignatureOfFunctionWithMangledName.kt index 3256ba1cc75..da7491e8a39 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericSignatureOfFunctionWithMangledName.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericSignatureOfFunctionWithMangledName.kt @@ -6,9 +6,11 @@ import kotlin.reflect.KFunction import kotlin.reflect.jvm.javaMethod import kotlin.test.* -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineClass1(val s: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineClass2(val n: Number) fun foo(t: T, u: U) {} diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/localClassInFunctionWithMangledName.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/localClassInFunctionWithMangledName.kt index 29a0a5eec5e..252abd22b56 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/localClassInFunctionWithMangledName.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/localClassInFunctionWithMangledName.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) fun foo(s: S): String { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsCanBeOverridden.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsCanBeOverridden.kt index 5c04b1d2a58..33c5229fbad 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsCanBeOverridden.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsCanBeOverridden.kt @@ -1,9 +1,11 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Id(val id: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Name(val name: String) interface IA { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsDoNotClash.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsDoNotClash.kt index b560ee9b7dd..e5cc9a942c7 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsDoNotClash.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsDoNotClash.kt @@ -1,12 +1,15 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Id(val id: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Name(val name: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Password(val password: String) fun test(id: Id) { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsPresentInStackTrace.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsPresentInStackTrace.kt index 624206e9de7..ed5ca8ceb1a 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsPresentInStackTrace.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsPresentInStackTrace.kt @@ -5,7 +5,8 @@ // WITH_RUNTIME // WASM_MUTE_REASON: IGNORED_IN_JS -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Id(val id: String) fun throws() { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mixedSignatureFunctionsDoNotClash.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mixedSignatureFunctionsDoNotClash.kt index 755c833a8ab..24164af2297 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mixedSignatureFunctionsDoNotClash.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mixedSignatureFunctionsDoNotClash.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Id(val id: String) fun test(id: Id, str: String) { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass.kt index 1a6582f1a9d..42343a74f2f 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass.kt @@ -4,7 +4,8 @@ abstract class GenericBase { abstract fun foo(x: T): T } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str(val str: String) class Derived : GenericBase() { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass2.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass2.kt index ed103617874..d7ecb2b04cd 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass2.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass2.kt @@ -8,7 +8,8 @@ interface IFoo { fun foo(x: String): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str(val str: String) class Derived : GenericBase(), IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/propertySetterWithInlineClassTypeArgument.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/propertySetterWithInlineClassTypeArgument.kt index 2e44f89d981..d5c08207990 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/propertySetterWithInlineClassTypeArgument.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/propertySetterWithInlineClassTypeArgument.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str(val string: String) class C { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForFunctionWithMangledName.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForFunctionWithMangledName.kt index 16d165be240..bd8fd6ae7b2 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForFunctionWithMangledName.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForFunctionWithMangledName.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME import kotlin.test.* -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) fun foo(s: S) = s diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForLocalClassInFunctionWithMangledName.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForLocalClassInFunctionWithMangledName.kt index 38add275d71..de2bee0dee7 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForLocalClassInFunctionWithMangledName.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForLocalClassInFunctionWithMangledName.kt @@ -2,7 +2,8 @@ // WITH_REFLECT import kotlin.test.* -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) fun test(s: S) { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForPropertyOfInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForPropertyOfInlineClassType.kt index 441f6eb7408..aab194caeb1 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForPropertyOfInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForPropertyOfInlineClassType.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME import kotlin.test.* -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) var prop = S("") diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorForFunctionWithMangledName.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorForFunctionWithMangledName.kt index 0360ca179a2..2e42c0677a7 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorForFunctionWithMangledName.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorForFunctionWithMangledName.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) class Outer { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorsForPropertyOfInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorsForPropertyOfInlineClassType.kt index 6f5e2d96089..ddb586751ef 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorsForPropertyOfInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorsForPropertyOfInlineClassType.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) class Outer { diff --git a/compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt b/compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt index d1f31315fcc..ab3438c7a1d 100644 --- a/compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt +++ b/compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt @@ -10,7 +10,8 @@ class C(val t: T) { // MODULE: lib2(lib1) // FILE: lib2.kt -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val c: C) { fun foo(): Int = c.hashCode() } diff --git a/compiler/testData/codegen/box/inlineClasses/genericVararg2ndConstructor.kt b/compiler/testData/codegen/box/inlineClasses/genericVararg2ndConstructor.kt index fd0b268b7cc..2ebc772666c 100644 --- a/compiler/testData/codegen/box/inlineClasses/genericVararg2ndConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/genericVararg2ndConstructor.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME // KT-41771 -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Polynomial(val coefficients: List) { constructor(vararg coefficients: T) : this(coefficients.toList()) } diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorReferencedFromOtherFile1.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorReferencedFromOtherFile1.kt index f1d084beedc..f573e5b3d93 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorReferencedFromOtherFile1.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorReferencedFromOtherFile1.kt @@ -5,7 +5,8 @@ fun box(): String = X(Z("OK")).z.result // FILE: 2.kt -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val result: String) class X(val z: Z) diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorReferencedFromOtherFile2.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorReferencedFromOtherFile2.kt index a3356755875..e780f2f197e 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorReferencedFromOtherFile2.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorReferencedFromOtherFile2.kt @@ -5,7 +5,8 @@ fun box(): String = X(Z("OK")).z.result // FILE: 1.kt -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val result: String) class X(val z: Z) diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorWithDefaultParameters.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorWithDefaultParameters.kt index 101554b5874..495a850f34a 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorWithDefaultParameters.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorWithDefaultParameters.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) class Test(val x: S, val y: S = S("K")) { diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCall.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCall.kt index 4bcc83962da..77720795b58 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCall.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) abstract class Base(val x: S) diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCallInSecondaryConstructor.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCallInSecondaryConstructor.kt index 5f9c645297f..9b9a4fd6221 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCallInSecondaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCallInSecondaryConstructor.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) abstract class Base(val x: S) diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingThisConstructorCall.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingThisConstructorCall.kt index 9a6be42bad5..481c2009a17 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingThisConstructorCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingThisConstructorCall.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) class Test(val x: S, val y: S) { diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/enumClassConstructor.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/enumClassConstructor.kt index ef2a35a337a..54ef091de8b 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/enumClassConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/enumClassConstructor.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) enum class Test(val s: S) { diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/innerClassConstructor.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/innerClassConstructor.kt index fb8120a6ff9..fc9a1c9fd8f 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/innerClassConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/innerClassConstructor.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) class Outer(val s1: S) { diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/primaryConstructor.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/primaryConstructor.kt index 6ae206fd994..a77fcce5b4b 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/primaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/primaryConstructor.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) class Test(val s: S) diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/privateConstructor.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/privateConstructor.kt index e8e241127cc..ba33b2d1314 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/privateConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/privateConstructor.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) class Outer private constructor(val s: S) { diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/sealedClassConstructor.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/sealedClassConstructor.kt index a11ffb4cea3..64a9fb4f016 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/sealedClassConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/sealedClassConstructor.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) sealed class Sealed(val x: S) diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/secondaryConstructor.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/secondaryConstructor.kt index 2a97ea77edc..23693ced65f 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/secondaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/secondaryConstructor.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val string: String) class Test(val s: S) { diff --git a/compiler/testData/codegen/box/inlineClasses/initBlock.kt b/compiler/testData/codegen/box/inlineClasses/initBlock.kt index 1fca2451715..795485a5142 100644 --- a/compiler/testData/codegen/box/inlineClasses/initBlock.kt +++ b/compiler/testData/codegen/box/inlineClasses/initBlock.kt @@ -1,13 +1,15 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class SingleInitBlock(val s: String) { init { res = s } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class MultipleInitBlocks(val a: Any?) { init { res = "O" @@ -17,7 +19,8 @@ value class MultipleInitBlocks(val a: Any?) { } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Lambda(val s: String) { init { val lambda = { res = s } @@ -25,7 +28,8 @@ value class Lambda(val s: String) { } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class FunLiteral(val s: String) { init { val funLiteral = fun() { @@ -35,7 +39,8 @@ value class FunLiteral(val s: String) { } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ObjectLiteral(val s: String) { init { val objectLiteral = object { @@ -47,7 +52,8 @@ value class ObjectLiteral(val s: String) { } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class LocalFunction(val s: String) { init { fun local() { @@ -57,7 +63,8 @@ value class LocalFunction(val s: String) { } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class LocalClass(val s: String) { init { class Local { @@ -69,7 +76,8 @@ value class LocalClass(val s: String) { } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Getter(val s: String) { init { res = ok @@ -79,7 +87,8 @@ value class Getter(val s: String) { get() = s } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class GetterThis(val s: String) { init { res = this.ok @@ -89,7 +98,8 @@ value class GetterThis(val s: String) { get() = s } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Method(val s: String) { init { res = ok(this) @@ -98,7 +108,8 @@ value class Method(val s: String) { fun ok(m: Method): String = m.s } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class MethodThis(val s: String) { init { res = this.ok(this) @@ -107,7 +118,8 @@ value class MethodThis(val s: String) { fun ok(m: MethodThis): String = m.s } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineFun(val s: String) { init { res = ok() @@ -116,7 +128,8 @@ value class InlineFun(val s: String) { inline fun ok(): String = s } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineFunThis(val s: String) { init { res = this.ok() diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt index 63f405ba95b..c33bf1d7fdb 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt @@ -1,13 +1,15 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Name(private val value: String) { fun asValue(): String = value } fun concat(a: Name, b: Name) = a.asValue() + b.asValue() -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(private val value: Int) { fun asValue(): Int = value } diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineCollectionOfInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineCollectionOfInlineClass.kt index 0e268a54bcc..71167a46521 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineCollectionOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineCollectionOfInlineClass.kt @@ -1,9 +1,11 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZArray(val storage: IntArray) : Collection { override val size: Int get() = storage.size diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineListOfInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineListOfInlineClass.kt index 55ac1cf55f2..691f2e40242 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineListOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineListOfInlineClass.kt @@ -1,9 +1,11 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZArray(val storage: IntArray) : List { override val size: Int get() = storage.size diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineMapOfInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineMapOfInlineClass.kt index 23830e65276..a1d3508a559 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineMapOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineMapOfInlineClass.kt @@ -1,9 +1,11 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZArrayMap(val storage: IntArray) : Map { override val size: Int get() = storage.size diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt index da87de900a0..a296985ec3d 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt @@ -1,9 +1,11 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineFloat(val data: Float) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineDouble(val data: Double) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt index f4806f4d2d4..fac437fed17 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt @@ -2,10 +2,12 @@ var result = "Fail" -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val value: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class B(val a: A) { init { result = a.value diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt index 63c31e23bb0..f4bba29e0bc 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt @@ -1,12 +1,15 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val int: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str(val string: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class NStr(val string: String?) fun fooZ(x: Z) = x diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassImplementsCollection.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassImplementsCollection.kt index c49d5471a0e..39b67cf12f4 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassImplementsCollection.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassImplementsCollection.kt @@ -1,10 +1,12 @@ // WITH_RUNTIME // TARGET_BACKEND: JVM -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class MyUInt(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class MyUIntArray(private val storage: IntArray) : Collection { public override val size: Int get() = storage.size diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt index 4e4b63d202e..7507fd4d332 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt @@ -2,7 +2,8 @@ var result = "Fail" -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val value: String) { fun f() = value + "K" } diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt index b1fbff5e54f..d51af1c4554 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt @@ -2,7 +2,8 @@ import kotlin.test.* -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val value: Int) fun test1_1(z: Z) = "$z" diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassPropertyReferenceGetAndSet.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassPropertyReferenceGetAndSet.kt index 66373461428..bbcb09bb127 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassPropertyReferenceGetAndSet.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassPropertyReferenceGetAndSet.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val z: String) var f = Foo("zzz") diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassValueCapturedInInlineLambda.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassValueCapturedInInlineLambda.kt index 2d27e5f16c6..e5b057177dc 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassValueCapturedInInlineLambda.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassValueCapturedInInlineLambda.kt @@ -1,12 +1,16 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val int: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val long: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str(val string: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Obj(val obj: Any) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassValueCapturedInNonInlineLambda.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassValueCapturedInNonInlineLambda.kt index 4c85b89a618..af83d0ef7a5 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassValueCapturedInNonInlineLambda.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassValueCapturedInNonInlineLambda.kt @@ -1,12 +1,16 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val int: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val long: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str(val string: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Obj(val obj: Any) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt index 46867fad72d..bf9ac5fb5a1 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt @@ -1,11 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Augmented(val x: Int) { override fun toString(): String = (x + 1).toString() } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class AsAny(val a: Any) { override fun toString(): String = "AsAny: $a" } diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassWithCustomEquals.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassWithCustomEquals.kt index c9f975f86d6..a6fb2e9eab5 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassWithCustomEquals.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassWithCustomEquals.kt @@ -5,7 +5,8 @@ @file:Suppress("RESERVED_MEMBER_INSIDE_INLINE_CLASS") -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val data: Int) { override fun equals(other: Any?): Boolean = other is Z && diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassWithDefaultFunctionsFromAny.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassWithDefaultFunctionsFromAny.kt index c2a68941447..803d5352ec9 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassWithDefaultFunctionsFromAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassWithDefaultFunctionsFromAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val data: Int) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassesAsInlineFunParameters.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassesAsInlineFunParameters.kt index 9fe2c11fa56..67e6da1a197 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassesAsInlineFunParameters.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassesAsInlineFunParameters.kt @@ -1,12 +1,16 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val int: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val long: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str(val string: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Obj(val obj: Any) inline fun s1Z(x: Z, fn: (Int, Z) -> R) = fn(1, x) diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassesCheckCast.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassesCheckCast.kt index a92b32f7ea8..e108e4d2c4f 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassesCheckCast.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassesCheckCast.kt @@ -1,8 +1,10 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class AsAny(val x: Any?) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class AsInt(val x: Int) inline fun Any?.checkcast(): T = this as T diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassesInInlineLambdaParameters.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassesInInlineLambdaParameters.kt index 669f9b8607c..44ff1201dfa 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassesInInlineLambdaParameters.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassesInInlineLambdaParameters.kt @@ -1,8 +1,10 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val int: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val long: Long) inline fun s0(x: T, fn: (Int, T) -> R) = fn(0, x) diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassesRefTypesInInlineLambdaParameters.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassesRefTypesInInlineLambdaParameters.kt index 331431b728f..5a157eddf2a 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassesRefTypesInInlineLambdaParameters.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassesRefTypesInInlineLambdaParameters.kt @@ -1,8 +1,10 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str(val string: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Obj(val obj: Any) inline fun s0(x: T, fn: (Int, T) -> R) = fn(0, x) diff --git a/compiler/testData/codegen/box/inlineClasses/inlineExtLambdaInInlineClassFun.kt b/compiler/testData/codegen/box/inlineClasses/inlineExtLambdaInInlineClassFun.kt index 4b0c9f9885e..92d641ce690 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineExtLambdaInInlineClassFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineExtLambdaInInlineClassFun.kt @@ -2,7 +2,8 @@ inline fun T.runInlineExt(fn: T.() -> String) = fn() -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { fun test() = runInlineExt { "OK" } } diff --git a/compiler/testData/codegen/box/inlineClasses/inlineExtLambdaInInlineClassFun2.kt b/compiler/testData/codegen/box/inlineClasses/inlineExtLambdaInInlineClassFun2.kt index 9a01efb6f18..3fa8ac3df29 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineExtLambdaInInlineClassFun2.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineExtLambdaInInlineClassFun2.kt @@ -2,7 +2,8 @@ inline fun T.runInlineExt(fn: T.() -> String) = fn() -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: String) { fun test() = runInlineExt { r } } diff --git a/compiler/testData/codegen/box/inlineClasses/inlineFunctionInsideInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/inlineFunctionInsideInlineClass.kt index fad5978390f..1d14a7b2d64 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineFunctionInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineFunctionInsideInlineClass.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val x: Int) { inline fun inc(): Foo = Foo(x + 1) } diff --git a/compiler/testData/codegen/box/inlineClasses/inlineInCompanion.kt b/compiler/testData/codegen/box/inlineClasses/inlineInCompanion.kt index 4f46b179474..87767b26159 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineInCompanion.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineInCompanion.kt @@ -3,7 +3,8 @@ // FILE: R.kt import kotlin.jvm.JvmInline -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(val value: String) { companion object { inline fun ok() = R("OK") diff --git a/compiler/testData/codegen/box/inlineClasses/inlineToString.kt b/compiler/testData/codegen/box/inlineClasses/inlineToString.kt index ceddf6ad283..71b74953bc8 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineToString.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineToString.kt @@ -7,7 +7,8 @@ open class Expando { val expansion: Expansion = Expansion() } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Expansion(val map: MutableMap = mutableMapOf()) { override inline fun toString(): String = "OK" } diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/interfaceImplementationByDelegation.kt b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/interfaceImplementationByDelegation.kt index 7cdb3fbce57..d820f2b6a39 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/interfaceImplementationByDelegation.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/interfaceImplementationByDelegation.kt @@ -7,7 +7,8 @@ interface IFoo { val ok: String get() = getO() + k } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineFooImpl(val s: String): IFoo { override fun getO(): String = s override val k: String get() = "K" diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/kt38337.kt b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/kt38337.kt index d317a47e03b..655fdfe9ce1 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/kt38337.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/kt38337.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Wrapper(val id: Int) class DMap(private val map: Map) : diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberExtValDelegationWithInlineClassParameterTypes.kt b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberExtValDelegationWithInlineClassParameterTypes.kt index 63d6dada93b..abd811206d1 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberExtValDelegationWithInlineClassParameterTypes.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberExtValDelegationWithInlineClassParameterTypes.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME import kotlin.test.assertEquals -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberExtVarDelegationWithInlineClassParameterTypes.kt b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberExtVarDelegationWithInlineClassParameterTypes.kt index 2676eca3b3a..1b9d45528be 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberExtVarDelegationWithInlineClassParameterTypes.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberExtVarDelegationWithInlineClassParameterTypes.kt @@ -2,7 +2,8 @@ import kotlin.test.assertEquals -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val xs: Array) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegatedToInlineClassInt.kt b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegatedToInlineClassInt.kt index 7db49237466..b281732e996 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegatedToInlineClassInt.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegatedToInlineClassInt.kt @@ -5,7 +5,8 @@ interface IFoo { fun foo(s: String): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) : IFoo { override fun foo(s: String): String = x.toString() + s } diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegatedToInlineClassLong.kt b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegatedToInlineClassLong.kt index a96c529bbc3..397088bf868 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegatedToInlineClassLong.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegatedToInlineClassLong.kt @@ -5,7 +5,8 @@ interface IFoo { fun foo(s: String): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Long) : IFoo { override fun foo(s: String): String = x.toString() + s } diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegationToInlineClassWithInlineClassParameterTypes.kt b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegationToInlineClassWithInlineClassParameterTypes.kt index d8c3eeca2d7..83c14e0e54c 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegationToInlineClassWithInlineClassParameterTypes.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegationToInlineClassWithInlineClassParameterTypes.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME import kotlin.test.assertEquals -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) interface IFoo { @@ -13,7 +14,8 @@ interface IFoo { fun T.genericMemberExtFun(x: X): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class FooImpl(val xs: Array) : IFoo { override fun memberFun(s1: S, s2: String): String = xs[0] + s1.x + s2 override fun memberFunT(x1: S, x2: String): String = xs[0] + x1.x + x2 diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegationWithInlineClassParameterTypes.kt b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegationWithInlineClassParameterTypes.kt index 7f1e330b252..2b8f150f14e 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegationWithInlineClassParameterTypes.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegationWithInlineClassParameterTypes.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME import kotlin.test.assertEquals -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride.kt index ad6265df315..b806660b858 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val s: String) abstract class B { diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride2.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride2.kt index 285be44b7a4..60e5f241742 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride2.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride2.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val s: String) interface B { diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride3.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride3.kt index 64aea31bd08..e76d63c88b2 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride3.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride3.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val s: String) interface B { diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceExtensionFunCall.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceExtensionFunCall.kt index 0e3fa5a5cae..147a4e6866f 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceExtensionFunCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceExtensionFunCall.kt @@ -5,17 +5,20 @@ interface IFoo { fun bar(): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) : IFoo { override fun bar(): String = "OK" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) : IFoo { override fun bar(): String = "OK" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) : IFoo { override fun bar(): String = "OK" } diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceMethodCall.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceMethodCall.kt index d4accbee19b..8c9577fbe9a 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceMethodCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceMethodCall.kt @@ -5,17 +5,20 @@ interface IFoo { fun bar(): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) : IFoo { override fun bar(): String = "OK" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) : IFoo { override fun bar(): String = "OK" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) : IFoo { override fun bar(): String = "OK" } diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericDefaultInterfaceExtensionFunCall.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericDefaultInterfaceExtensionFunCall.kt index de883b84fef..4080fa4b466 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericDefaultInterfaceExtensionFunCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericDefaultInterfaceExtensionFunCall.kt @@ -5,17 +5,20 @@ interface IFoo> { fun bar(): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) : IFoo { override fun bar(): String = "OK" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) : IFoo { override fun bar(): String = "OK" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) : IFoo { override fun bar(): String = x } diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericDefaultInterfaceMethodCall.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericDefaultInterfaceMethodCall.kt index 8130735d9c5..20f486a75e6 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericDefaultInterfaceMethodCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericDefaultInterfaceMethodCall.kt @@ -5,7 +5,8 @@ interface IFoo> { fun bar(): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) : IFoo { override fun bar(): String = "OK" } diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericInterfaceMethodCall.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericInterfaceMethodCall.kt index 4f03a5b11fb..6bf21b112e9 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericInterfaceMethodCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericInterfaceMethodCall.kt @@ -4,7 +4,8 @@ interface IFoo { fun foo(x: T): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) : IFoo { override fun foo(x: Z) = "OK" } diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericMethodWithInlineClassOverride.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericMethodWithInlineClassOverride.kt index 0a3f0ab0f2f..b1b7dc712b9 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericMethodWithInlineClassOverride.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericMethodWithInlineClassOverride.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val s: String) abstract class B { diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/interfaceSuperCall.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/interfaceSuperCall.kt index b5307cb6514..71fa42c57ee 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/interfaceSuperCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/interfaceSuperCall.kt @@ -4,7 +4,8 @@ interface A { fun f(x: String) = x } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class B(val y: String) : A { override fun f(x: String) = super.f(x + y) } diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/overriddenDefaultInterfaceMethodCall.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/overriddenDefaultInterfaceMethodCall.kt index 924a526fab8..026512d3fb1 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/overriddenDefaultInterfaceMethodCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/overriddenDefaultInterfaceMethodCall.kt @@ -8,13 +8,16 @@ interface IFoo : IBase { override fun foo() = "OK" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) : IFoo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class L(val x: Long) : IFoo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) : IFoo fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/iterateOverArrayOfInlineClassValues.kt b/compiler/testData/codegen/box/inlineClasses/iterateOverArrayOfInlineClassValues.kt index d0b26898994..dd530301c4a 100644 --- a/compiler/testData/codegen/box/inlineClasses/iterateOverArrayOfInlineClassValues.kt +++ b/compiler/testData/codegen/box/inlineClasses/iterateOverArrayOfInlineClassValues.kt @@ -1,8 +1,10 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val arg: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class AsAny(val arg: Any) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/iterateOverListOfInlineClassValues.kt b/compiler/testData/codegen/box/inlineClasses/iterateOverListOfInlineClassValues.kt index 711ce54f41e..65036712f11 100644 --- a/compiler/testData/codegen/box/inlineClasses/iterateOverListOfInlineClassValues.kt +++ b/compiler/testData/codegen/box/inlineClasses/iterateOverListOfInlineClassValues.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val arg: String) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/javaClassIntrinsicOnInlineClasses.kt b/compiler/testData/codegen/box/inlineClasses/javaClassIntrinsicOnInlineClasses.kt index c0973b4c09f..a1ed87320e6 100644 --- a/compiler/testData/codegen/box/inlineClasses/javaClassIntrinsicOnInlineClasses.kt +++ b/compiler/testData/codegen/box/inlineClasses/javaClassIntrinsicOnInlineClasses.kt @@ -3,13 +3,17 @@ package root -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcInt(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcLong(val l: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcAny(val a: Any?) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcOverIc(val o: IcLong) fun check(c: Class<*>, s: String) { diff --git a/compiler/testData/codegen/box/inlineClasses/javaPrimitiveTypeIC.kt b/compiler/testData/codegen/box/inlineClasses/javaPrimitiveTypeIC.kt index 9a3d4164525..4b3b102932c 100644 --- a/compiler/testData/codegen/box/inlineClasses/javaPrimitiveTypeIC.kt +++ b/compiler/testData/codegen/box/inlineClasses/javaPrimitiveTypeIC.kt @@ -2,13 +2,17 @@ // WITH_RUNTIME import kotlin.test.* -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class I(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class JLI(val x: java.lang.Integer) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class U(val x: Unit?) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class N(val x: Nothing?) val icUnit = U(Unit) diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt index 4ff89ac8114..73eb36a0ffb 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt @@ -2,7 +2,8 @@ // JVM_TARGET: 1.8 // WITH_RUNTIME // FILE: javaDefaultMethod.kt -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class K(val k: String) : J { override fun get2() = k } diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethodOverriddenByKotlin.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethodOverriddenByKotlin.kt index bc9cd70d608..5695679707f 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethodOverriddenByKotlin.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethodOverriddenByKotlin.kt @@ -6,7 +6,8 @@ interface K2 : J { override fun get2() = "Kotlin" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class K(val k: String) : K2 { override fun get2() = k } diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAll.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAll.kt index 807ccabc090..061d5d7cedc 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAll.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAll.kt @@ -11,12 +11,14 @@ interface IFooBar { interface IFooBar2 : IFooBar -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Test1(val k: String): IFooBar { override fun bar(): String = k } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Test2(val k: String): IFooBar2 { override fun bar(): String = k } diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllPrimaryProperty.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllPrimaryProperty.kt index 98cfce3457c..d0ae3aa949c 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllPrimaryProperty.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllPrimaryProperty.kt @@ -11,10 +11,12 @@ interface IFooBar { interface IFooBar2 : IFooBar -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Test1(override val bar: String): IFooBar -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Test2(override val bar: String): IFooBar2 fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllProperty.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllProperty.kt index b53cde82eda..47b145d2d08 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllProperty.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllProperty.kt @@ -11,13 +11,15 @@ interface IFooBar { interface IFooBar2 : IFooBar -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Test1(val k: String): IFooBar { override val bar: String get() = k } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Test2(val k: String): IFooBar2 { override val bar: String get() = k diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnable.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnable.kt index 2d8fcaa1094..95b54fc000b 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnable.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnable.kt @@ -11,12 +11,14 @@ interface IFooBar { interface IFooBar2 : IFooBar -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Test1(val k: String): IFooBar { override fun bar(): String = k } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Test2(val k: String): IFooBar2 { override fun bar(): String = k } diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnablePrimaryProperty.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnablePrimaryProperty.kt index 0ef8feb7216..de4a66aabf5 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnablePrimaryProperty.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnablePrimaryProperty.kt @@ -11,10 +11,12 @@ interface IFooBar { interface IFooBar2 : IFooBar -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Test1(override val bar: String): IFooBar -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Test2(override val bar: String): IFooBar2 fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt index b43d348fdaa..7570288d161 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt @@ -11,13 +11,15 @@ interface IFooBar { interface IFooBar2 : IFooBar -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Test1(val k: String): IFooBar { override val bar: String get() = k } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Test2(val k: String): IFooBar2 { override val bar: String get() = k diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultGeneric.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultGeneric.kt index a9877f88eb9..1655e1ce030 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultGeneric.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultGeneric.kt @@ -9,7 +9,8 @@ interface IOk { fun ok(): String = "OK" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineClass(val s: String) : IOk fun test(cell: Cell): String = cell.x.ok() diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSafeCall.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSafeCall.kt index 02de8d20073..0893ee063d1 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSafeCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSafeCall.kt @@ -7,7 +7,8 @@ interface IOk { fun ok(): String = "OK" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineClass(val s: String) : IOk fun test(x: InlineClass?) = x?.ok() ?: "Failed" diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSmartCast.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSmartCast.kt index 5f3edb4d72d..57f006a2efb 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSmartCast.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSmartCast.kt @@ -7,7 +7,8 @@ interface IOk { fun ok(): String = "OK" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineClass(val s: String) : IOk fun test(x: Any): String { diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSuspend.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSuspend.kt index 3527a6dba3a..20400c07628 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSuspend.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSuspend.kt @@ -9,7 +9,8 @@ interface IOk { fun ok(): String = "OK" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineClass(val s: String) : IOk suspend fun returnsUnboxed() = InlineClass("") diff --git a/compiler/testData/codegen/box/inlineClasses/jvmFieldInInlineClassCompanion.kt b/compiler/testData/codegen/box/inlineClasses/jvmFieldInInlineClassCompanion.kt index 7fc648fb068..874c7ff807f 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvmFieldInInlineClassCompanion.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvmFieldInInlineClassCompanion.kt @@ -2,7 +2,8 @@ // WITH_RUNTIME // FILE: test.kt -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/jvmOverloadsOnTopLevelFunctionReturningInlineClassValue.kt b/compiler/testData/codegen/box/inlineClasses/jvmOverloadsOnTopLevelFunctionReturningInlineClassValue.kt index 3b119bad77f..3777acf5c2e 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvmOverloadsOnTopLevelFunctionReturningInlineClassValue.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvmOverloadsOnTopLevelFunctionReturningInlineClassValue.kt @@ -1,7 +1,8 @@ // TARGET_BACKEND: JVM // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str(val s: String) @JvmOverloads diff --git a/compiler/testData/codegen/box/inlineClasses/jvmStaticFunInInlineClassCompanion.kt b/compiler/testData/codegen/box/inlineClasses/jvmStaticFunInInlineClassCompanion.kt index 98392fcc7bf..5737a6007ad 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvmStaticFunInInlineClassCompanion.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvmStaticFunInInlineClassCompanion.kt @@ -2,7 +2,8 @@ // WITH_RUNTIME // FILE: test.kt -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/jvmStaticPropertyAccessorInInlineClassCompanion.kt b/compiler/testData/codegen/box/inlineClasses/jvmStaticPropertyAccessorInInlineClassCompanion.kt index 4d779fdd4e0..469869e3108 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvmStaticPropertyAccessorInInlineClassCompanion.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvmStaticPropertyAccessorInInlineClassCompanion.kt @@ -2,7 +2,8 @@ // WITH_RUNTIME // FILE: test.kt -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/jvmStaticVarInInlineClassCompanion.kt b/compiler/testData/codegen/box/inlineClasses/jvmStaticVarInInlineClassCompanion.kt index a6cdeabe6ce..fb584722d77 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvmStaticVarInInlineClassCompanion.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvmStaticVarInInlineClassCompanion.kt @@ -2,7 +2,8 @@ // WITH_RUNTIME // FILE: test.kt -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class R(private val r: Int) { companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/kclassInAnnotation.kt b/compiler/testData/codegen/box/inlineClasses/kclassInAnnotation.kt index 766818743fa..50d1c1903a4 100644 --- a/compiler/testData/codegen/box/inlineClasses/kclassInAnnotation.kt +++ b/compiler/testData/codegen/box/inlineClasses/kclassInAnnotation.kt @@ -5,25 +5,32 @@ package test import kotlin.reflect.KClass -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ICInt(val i: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ICIntArray(val i: IntArray) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ICIntN(val i: Int?) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ICIntNArray(val i: Array) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ICAny(val a: Any) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ICAnyArray(val a: Array) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ICAnyNArray(val a: Array) annotation class Ann(val c: KClass<*>) diff --git a/compiler/testData/codegen/box/inlineClasses/kt25246.kt b/compiler/testData/codegen/box/inlineClasses/kt25246.kt index e9225657cd3..b2e1c41a081 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt25246.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt25246.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Rgba(val value: Int) { inline val r: Int get() = (value shr 0) and 0xFF inline val g: Int get() = (value shr 8) and 0xFF @@ -19,7 +20,8 @@ fun Rgba.withG(g: Int) = Rgba(r, g, b, a) fun Rgba.withB(b: Int) = Rgba(r, g, b, a) fun Rgba.withA(a: Int) = Rgba(r, g, b, a) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class RgbaArray(val array: IntArray) { constructor(size: Int) : this(IntArray(size)) operator fun get(index: Int): Rgba = Rgba(array[index]) diff --git a/compiler/testData/codegen/box/inlineClasses/kt25750.kt b/compiler/testData/codegen/box/inlineClasses/kt25750.kt index ceaa62c8690..ed71012dbf3 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt25750.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt25750.kt @@ -6,7 +6,8 @@ import kotlin.reflect.KProperty operator fun KMutableProperty0.setValue(host: Any?, property: KProperty<*>, value: R) = set(value) operator fun KMutableProperty0.getValue(host: Any?, property: KProperty<*>): R = get() -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val i: Int) var f = Foo(4) diff --git a/compiler/testData/codegen/box/inlineClasses/kt25771.kt b/compiler/testData/codegen/box/inlineClasses/kt25771.kt index 9c27fb07c83..c58720c544d 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt25771.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt25771.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Result(val value: Any?) { val isFailure: Boolean get() = value is Failure diff --git a/compiler/testData/codegen/box/inlineClasses/kt26103.kt b/compiler/testData/codegen/box/inlineClasses/kt26103.kt index 35f6dacf302..c94d4366084 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt26103.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt26103.kt @@ -1,13 +1,17 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Bar(val y: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo2(val x: Foo) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo3(val x: Bar) fun testValueParameter(z: Foo) = z.x diff --git a/compiler/testData/codegen/box/inlineClasses/kt26103_contravariantUnderlyingType.kt b/compiler/testData/codegen/box/inlineClasses/kt26103_contravariantUnderlyingType.kt index 8376df37ce2..9ea4c7d23af 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt26103_contravariantUnderlyingType.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt26103_contravariantUnderlyingType.kt @@ -1,26 +1,34 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class GCmp(val xc: Comparable) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class GSCmp(val sc: Comparable) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class SCmp(val sc: Comparable) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ICmp(val intc: Comparable) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class GICmp(val intc: Comparable) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class II(val i: Int) : Comparable { override fun compareTo(other: II): Int { return i.compareTo(other.i) } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IICmp(val iic: Comparable) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class GIICmp(val iic: Comparable) fun testGCmp(x: GCmp) { diff --git a/compiler/testData/codegen/box/inlineClasses/kt26103_covariantUnderlyingType.kt b/compiler/testData/codegen/box/inlineClasses/kt26103_covariantUnderlyingType.kt index cd956d28a1e..fe340483ccf 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt26103_covariantUnderlyingType.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt26103_covariantUnderlyingType.kt @@ -1,21 +1,29 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class GList(val xs: List) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class GSList(val ss: List) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class SList(val ss: List) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IList(val ints: List) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class GIList(val ints: List) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class II(val i: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IIList(val iis: List) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class GIIList(val iis: List) fun testGList(gl: GList) { diff --git a/compiler/testData/codegen/box/inlineClasses/kt26103_original.kt b/compiler/testData/codegen/box/inlineClasses/kt26103_original.kt index 18f721cf811..e782361b3ea 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt26103_original.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt26103_original.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val x: Int) class Bar(val y: Foo) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096.kt b/compiler/testData/codegen/box/inlineClasses/kt27096.kt index 642eadac244..56abf077302 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Ucn(private val i: UInt) class PPInput(private val s: ByteArray) { diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096_enum.kt b/compiler/testData/codegen/box/inlineClasses/kt27096_enum.kt index 2abb8689000..6327c497645 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096_enum.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096_enum.kt @@ -2,11 +2,14 @@ enum class En { N, A, B, C } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z1(val x: En) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z2(val z: Z1) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZN(val z: Z1?) fun wrap1(x: En): Z1? = if (x.ordinal == 0) null else Z1(x) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096_functional.kt b/compiler/testData/codegen/box/inlineClasses/kt27096_functional.kt index a9ea24f0bca..35ca4953481 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096_functional.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096_functional.kt @@ -1,10 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z1(val x: () -> String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z2(val z: Z1) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZN(val z: Z1?) fun wrap1(x: String): Z1? = if (x.length == 0) null else Z1({ x }) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096_innerClass.kt b/compiler/testData/codegen/box/inlineClasses/kt27096_innerClass.kt index c8791159d38..75041d4d1ae 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096_innerClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096_innerClass.kt @@ -13,11 +13,14 @@ class Outer(val x: X) { } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z1(val x: Outer.Inner) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z2(val z: Z1) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZN(val z: Z1?) fun wrap1(xy : Outer.Inner): Z1? = if (xy.hasNull) null else Z1(xy) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096_nullablePrimitive.kt b/compiler/testData/codegen/box/inlineClasses/kt27096_nullablePrimitive.kt index d3cfe8db8eb..951ddbf3857 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096_nullablePrimitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096_nullablePrimitive.kt @@ -1,10 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z1(val x: Int?) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z2(val z: Z1) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZN(val z: Z1?) fun wrap1(n: Int): Z1? = if (n < 0) null else Z1(n) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096_nullableReference.kt b/compiler/testData/codegen/box/inlineClasses/kt27096_nullableReference.kt index 999d7019fe8..7addebacc0b 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096_nullableReference.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096_nullableReference.kt @@ -1,10 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z1(val x: String?) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z2(val z: Z1) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZN(val z: Z1?) fun wrap1(x: String): Z1? = if (x.length == 0) null else Z1(x) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096_primitive.kt b/compiler/testData/codegen/box/inlineClasses/kt27096_primitive.kt index d8221bc76d6..5b347dbbb70 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096_primitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096_primitive.kt @@ -1,12 +1,16 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z1(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z2(val z: Z1) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZN(val z: Z1?) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZN2(val z: ZN) fun wrap1(n: Int): Z1? = if (n < 0) null else Z1(n) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096_reference.kt b/compiler/testData/codegen/box/inlineClasses/kt27096_reference.kt index 1991ebf84a6..0df9797e85e 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096_reference.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096_reference.kt @@ -1,12 +1,16 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z1(val x: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z2(val z: Z1) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZN(val z: Z1?) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZN2(val z: ZN) fun wrap1(x: String): Z1? = if (x.length == 0) null else Z1(x) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27113.kt b/compiler/testData/codegen/box/inlineClasses/kt27113.kt index 7e65e8adb9c..e3555113125 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27113.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27113.kt @@ -8,7 +8,8 @@ class CharacterLiteral(private val prefix: NamelessString, private val s: Namele override fun toString(): String = "$prefix'$s'" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class NamelessString(val b: ByteArray) { override fun toString(): String = String(b) } diff --git a/compiler/testData/codegen/box/inlineClasses/kt27113a.kt b/compiler/testData/codegen/box/inlineClasses/kt27113a.kt index 8a03b6c870f..ecea4cd4609 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27113a.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27113a.kt @@ -1,9 +1,11 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val a: Any) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class NA(val b: Any?) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/kt27132.kt b/compiler/testData/codegen/box/inlineClasses/kt27132.kt index e980ca0f19c..51dc1806ce3 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27132.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27132.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Ucn(private val i: UInt) interface Input { diff --git a/compiler/testData/codegen/box/inlineClasses/kt27140.kt b/compiler/testData/codegen/box/inlineClasses/kt27140.kt index 04405b7425c..3e1a5290b32 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27140.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27140.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(private val i: Int) { fun toByteArray() = ByteArray(1) { i.toByte() } } diff --git a/compiler/testData/codegen/box/inlineClasses/kt27705.kt b/compiler/testData/codegen/box/inlineClasses/kt27705.kt index a1d1da76bb4..c6f17a2f155 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27705.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27705.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) { @Suppress("INNER_CLASS_INSIDE_INLINE_CLASS") inner class Inner(val y: Int) { diff --git a/compiler/testData/codegen/box/inlineClasses/kt27706.kt b/compiler/testData/codegen/box/inlineClasses/kt27706.kt index 7c17dbfb640..6ff72a15005 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27706.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27706.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) { @Suppress("INNER_CLASS_INSIDE_INLINE_CLASS") inner class Inner(val z: Z) { diff --git a/compiler/testData/codegen/box/inlineClasses/kt28405.kt b/compiler/testData/codegen/box/inlineClasses/kt28405.kt index dc28322409b..3db05d92607 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt28405.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt28405.kt @@ -4,15 +4,18 @@ import kotlin.test.* -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class TestUIntArrayW(val x: UIntArray) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineCharArray(val x: CharArray) { override fun toString(): String = x.contentToString() } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class TestInlineCharArrayW(val x: InlineCharArray) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/kt33119.kt b/compiler/testData/codegen/box/inlineClasses/kt33119.kt index 28e203539ec..398efb930bd 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt33119.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt33119.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class WrappingInt(val value: Int) { operator fun inc(): WrappingInt = plus(1) operator fun plus(num: Int): WrappingInt = WrappingInt((value + num) and 0xFFFF) diff --git a/compiler/testData/codegen/box/inlineClasses/kt37998.kt b/compiler/testData/codegen/box/inlineClasses/kt37998.kt index 7c774a62a3c..034ffb48316 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt37998.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt37998.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) class A { diff --git a/compiler/testData/codegen/box/inlineClasses/kt38680.kt b/compiler/testData/codegen/box/inlineClasses/kt38680.kt index 432dcb7c7ca..faba2bec77d 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt38680.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt38680.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val s: String) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/kt38680a.kt b/compiler/testData/codegen/box/inlineClasses/kt38680a.kt index 66ba145e370..774f74eeed7 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt38680a.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt38680a.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val s: String) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/kt38680b.kt b/compiler/testData/codegen/box/inlineClasses/kt38680b.kt index f3eceb56b90..ddf8121285e 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt38680b.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt38680b.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val s: String) interface IFoo { diff --git a/compiler/testData/codegen/box/inlineClasses/kt44701_jvmOverloads.kt b/compiler/testData/codegen/box/inlineClasses/kt44701_jvmOverloads.kt index 556275aedc0..38d3062ba0e 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt44701_jvmOverloads.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt44701_jvmOverloads.kt @@ -2,7 +2,8 @@ // IGNORE_BACKEND: JVM // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Location @JvmOverloads constructor(val value: String? = "OK") fun box(): String = Location().value!! diff --git a/compiler/testData/codegen/box/inlineClasses/kt44978.kt b/compiler/testData/codegen/box/inlineClasses/kt44978.kt index 14dc1a2d81b..274aa68d542 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt44978.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt44978.kt @@ -1,7 +1,8 @@ // IGNORE_BACKEND: JVM // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class StringArray(val values: Array) fun foo(a1: StringArray, a2: StringArray): String { diff --git a/compiler/testData/codegen/box/inlineClasses/kt45084.kt b/compiler/testData/codegen/box/inlineClasses/kt45084.kt index b0085834b1e..c3352e65591 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt45084.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt45084.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val value: Long) fun f(g: ( diff --git a/compiler/testData/codegen/box/inlineClasses/kt46554.kt b/compiler/testData/codegen/box/inlineClasses/kt46554.kt index 6f1c48e0568..83d1fd6d203 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt46554.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt46554.kt @@ -2,7 +2,8 @@ var result = "Fail" -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val value: String) { constructor() : this("OK") diff --git a/compiler/testData/codegen/box/inlineClasses/kt47609.kt b/compiler/testData/codegen/box/inlineClasses/kt47609.kt index e1bd07115fc..b42ee03777c 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt47609.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt47609.kt @@ -4,7 +4,8 @@ annotation class Ann(val value: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class C(val x: String) @Ann("OK") diff --git a/compiler/testData/codegen/box/inlineClasses/kt47762.kt b/compiler/testData/codegen/box/inlineClasses/kt47762.kt index 7693c4aad9d..efb0bc252bd 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt47762.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt47762.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val a: Int = 1) { companion object { val a: Int = 2 diff --git a/compiler/testData/codegen/box/inlineClasses/kt48993.kt b/compiler/testData/codegen/box/inlineClasses/kt48993.kt index 06613d46ff2..58166532831 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt48993.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt48993.kt @@ -1,7 +1,8 @@ // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: 1.kt -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class C(val x: String) // FILE: 2.kt diff --git a/compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt b/compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt index 51e94c70320..bca69d48f20 100644 --- a/compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt +++ b/compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt @@ -1,5 +1,6 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class X(val s: String) fun foo(x: X, block: (X) -> String = { it.s }) = block(x) diff --git a/compiler/testData/codegen/box/inlineClasses/mangledSuperCalls.kt b/compiler/testData/codegen/box/inlineClasses/mangledSuperCalls.kt index 38d21f7cd63..df8fb811a75 100644 --- a/compiler/testData/codegen/box/inlineClasses/mangledSuperCalls.kt +++ b/compiler/testData/codegen/box/inlineClasses/mangledSuperCalls.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class I(val i: Int) abstract class A { diff --git a/compiler/testData/codegen/box/inlineClasses/mappingOfBoxedFlexibleInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/mappingOfBoxedFlexibleInlineClassType.kt index dd45fdae298..b93d9adc927 100644 --- a/compiler/testData/codegen/box/inlineClasses/mappingOfBoxedFlexibleInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/mappingOfBoxedFlexibleInlineClassType.kt @@ -9,13 +9,17 @@ public class JavaClass { // FILE: test.kt -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcInt(val i: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcLong(val l: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcAny(val a: Any?) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IcOverIc(val o: IcInt) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/nestedInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/nestedInlineClass.kt index 6b0ed8590fe..9ce727c6bd4 100644 --- a/compiler/testData/codegen/box/inlineClasses/nestedInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/nestedInlineClass.kt @@ -1,22 +1,26 @@ // WITH_RUNTIME class C { - @JvmInline + @Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC1(val s: String) companion object { - @JvmInline + @Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC2(val s: String) } } object O { - @JvmInline + @Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC3(val s: String) } interface I { - @JvmInline + @Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC4(val s: String) } diff --git a/compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt b/compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt index 85054fa64b3..b6a9b760201 100644 --- a/compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt +++ b/compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Result(val a: Any?) fun resultOfIntToResultOfInt(r: Result): Result { diff --git a/compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt b/compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt index e910ac83b18..758412a7003 100644 --- a/compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt +++ b/compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME // !LANGUAGE: -MangleClassMembersReturningInlineClasses -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) class Test { diff --git a/compiler/testData/codegen/box/inlineClasses/noReturnTypeManglingJvmName.kt b/compiler/testData/codegen/box/inlineClasses/noReturnTypeManglingJvmName.kt index 38a0f2ba728..a54544f0355 100644 --- a/compiler/testData/codegen/box/inlineClasses/noReturnTypeManglingJvmName.kt +++ b/compiler/testData/codegen/box/inlineClasses/noReturnTypeManglingJvmName.kt @@ -2,7 +2,8 @@ // WITH_RUNTIME // TARGET_BACKEND: JVM -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class S(val x: String) class Test { diff --git a/compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt b/compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt index 0abee7c363b..fee5d5e7de0 100644 --- a/compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val value: Int) fun eq(a: Z?, b: Z) = a == b diff --git a/compiler/testData/codegen/box/inlineClasses/nullableWrapperEquality.kt b/compiler/testData/codegen/box/inlineClasses/nullableWrapperEquality.kt index 292a4eb2342..52ec124eb28 100644 --- a/compiler/testData/codegen/box/inlineClasses/nullableWrapperEquality.kt +++ b/compiler/testData/codegen/box/inlineClasses/nullableWrapperEquality.kt @@ -1,10 +1,13 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z1(val x: String) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZN(val z: Z1?) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZN2(val z: ZN) fun zap(b: Boolean): ZN2? = if (b) null else ZN2(ZN(null)) diff --git a/compiler/testData/codegen/box/inlineClasses/overridingFunCallingPrivateFun.kt b/compiler/testData/codegen/box/inlineClasses/overridingFunCallingPrivateFun.kt index df07654f9a5..64f51033003 100644 --- a/compiler/testData/codegen/box/inlineClasses/overridingFunCallingPrivateFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/overridingFunCallingPrivateFun.kt @@ -4,7 +4,8 @@ interface IFoo { fun foo(): String } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val x: String) : IFoo { private fun privateFun() = x override fun foo() = privateFun() diff --git a/compiler/testData/codegen/box/inlineClasses/passInlineClassAsVararg.kt b/compiler/testData/codegen/box/inlineClasses/passInlineClassAsVararg.kt index 723d6269f6b..a6809fe760c 100644 --- a/compiler/testData/codegen/box/inlineClasses/passInlineClassAsVararg.kt +++ b/compiler/testData/codegen/box/inlineClasses/passInlineClassAsVararg.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(val value: Int) fun takeVarargs(vararg e: T): T { diff --git a/compiler/testData/codegen/box/inlineClasses/passInlineClassWithSpreadOperatorToVarargs.kt b/compiler/testData/codegen/box/inlineClasses/passInlineClassWithSpreadOperatorToVarargs.kt index d2208cf66e3..67a8559061a 100644 --- a/compiler/testData/codegen/box/inlineClasses/passInlineClassWithSpreadOperatorToVarargs.kt +++ b/compiler/testData/codegen/box/inlineClasses/passInlineClassWithSpreadOperatorToVarargs.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(val value: Int) fun last(vararg e: T): T = e[e.size - 1] diff --git a/compiler/testData/codegen/box/inlineClasses/privateConstructorFunInterfaceMultiModule.kt b/compiler/testData/codegen/box/inlineClasses/privateConstructorFunInterfaceMultiModule.kt index a11f09d056c..c8f15900f3b 100644 --- a/compiler/testData/codegen/box/inlineClasses/privateConstructorFunInterfaceMultiModule.kt +++ b/compiler/testData/codegen/box/inlineClasses/privateConstructorFunInterfaceMultiModule.kt @@ -2,7 +2,8 @@ // WITH_RUNTIME // FILE: lib.kt -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z private constructor(private val value: Any?) { fun result(): String = value as String diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/captureLocalVarDelegatedToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/captureLocalVarDelegatedToInlineClass.kt index 990fa8d605f..6490269f75b 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/captureLocalVarDelegatedToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/captureLocalVarDelegatedToInlineClass.kt @@ -4,7 +4,8 @@ var setterInvoked = 0 var backing = 42 -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class DelegateStr(val ignored: String) { operator fun getValue(thisRef: Any?, prop: Any?) = @@ -16,7 +17,8 @@ value class DelegateStr(val ignored: String) { } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class DelegateInt(val ignored: Int) { operator fun getValue(thisRef: Any?, prop: Any?) = @@ -28,7 +30,8 @@ value class DelegateInt(val ignored: Int) { } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class DelegateLong(val ignored: Long) { operator fun getValue(thisRef: Any?, prop: Any?) = diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClass.kt index ee73782afb9..4578085b42f 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClass.kt @@ -7,7 +7,8 @@ class Foo { var setterInvoked = 0 -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Delegate(val default: Int) { operator fun getValue(thisRef: Any?, prop: Any?) = diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClassWithProvideDelegate.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClassWithProvideDelegate.kt index fea7b169fdd..39b05e58d8b 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClassWithProvideDelegate.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClassWithProvideDelegate.kt @@ -8,7 +8,8 @@ class Foo { var provideDelegateInvoked = 0 var setterInvoked = 0 -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class DelegateFactory(val default: Int) { operator fun provideDelegate(thisRef: Any?, prop: Any?): Delegate { provideDelegateInvoked++ @@ -16,7 +17,8 @@ value class DelegateFactory(val default: Int) { } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Delegate(val default: Int) { operator fun getValue(thisRef: Any?, prop: Any?) = diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateCompanionVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateCompanionVarToInlineClass.kt index 7b598dca1d3..c49e3978264 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateCompanionVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateCompanionVarToInlineClass.kt @@ -9,7 +9,8 @@ class Foo { var setterInvoked = 0 -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Delegate(val ignored: Int) { operator fun getValue(thisRef: Any?, prop: Any?) = Foo.a diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateJvmStaticCompanionVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateJvmStaticCompanionVarToInlineClass.kt index 07d53ab555b..e84f9d26904 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateJvmStaticCompanionVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateJvmStaticCompanionVarToInlineClass.kt @@ -10,7 +10,8 @@ class Foo { var setterInvoked = 0 -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Delegate(val ignored: Int) { operator fun getValue(thisRef: Any?, prop: Any?) = Foo.a diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateLocalVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateLocalVarToInlineClass.kt index 8e48f95659e..803e8275e4c 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateLocalVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateLocalVarToInlineClass.kt @@ -4,7 +4,8 @@ var setterInvoked = 0 var backing = 42 -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class DelegateStr(val ignored: String) { operator fun getValue(thisRef: Any?, prop: Any?) = @@ -16,7 +17,8 @@ value class DelegateStr(val ignored: String) { } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class DelegateInt(val ignored: Int) { operator fun getValue(thisRef: Any?, prop: Any?) = @@ -28,7 +30,8 @@ value class DelegateInt(val ignored: Int) { } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class DelegateLong(val ignored: Long) { operator fun getValue(thisRef: Any?, prop: Any?) = diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateObjectVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateObjectVarToInlineClass.kt index f1eac6c22a5..5642aa3a9ed 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateObjectVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateObjectVarToInlineClass.kt @@ -7,7 +7,8 @@ object Foo { var setterInvoked = 0 -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Delegate(val ignored: Int) { operator fun getValue(thisRef: Any?, prop: Any?) = Foo.a diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatePrivateCompanionVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatePrivateCompanionVarToInlineClass.kt index 8599e930b85..bf04607e62f 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatePrivateCompanionVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatePrivateCompanionVarToInlineClass.kt @@ -12,7 +12,8 @@ class Foo { var setterInvoked = 0 -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Delegate(val ignored: Int) { operator fun getValue(thisRef: Any?, prop: Any?) = Foo.a diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateTopLevelVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateTopLevelVarToInlineClass.kt index fe7182ed98e..94746451364 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateTopLevelVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateTopLevelVarToInlineClass.kt @@ -3,7 +3,8 @@ var setterInvoked = 0 var backing = 42 -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Delegate(val ignored: Int) { operator fun getValue(thisRef: Any?, prop: Any?) = diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatedPropertyOfInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatedPropertyOfInlineClassType.kt index 0ce7d806721..d9383e40ccf 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatedPropertyOfInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatedPropertyOfInlineClassType.kt @@ -2,11 +2,14 @@ import kotlin.reflect.KProperty -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ICInt(val i: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ICLong(val l: Long) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ICOverIC(val o: ICLong) class Delegate(var f: () -> T) { diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt27070.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt27070.kt index 5a6b6b43527..4639b039397 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt27070.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt27070.kt @@ -8,7 +8,8 @@ class Foo { val b by Delegate(0) } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Delegate(val ignored: Int): ReadOnlyProperty { override fun getValue(thisRef: Foo, property: KProperty<*>): Int { return thisRef.a diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt42933.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt42933.kt index a0279bd8f97..b3e2bdcba77 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt42933.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt42933.kt @@ -4,7 +4,8 @@ class Delegate { operator fun getValue(t: Any?, p: Any): String = "OK" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Kla1(val default: Int) { fun getValue(): String { val prop by Delegate() diff --git a/compiler/testData/codegen/box/inlineClasses/propertyLoweringOrder.kt b/compiler/testData/codegen/box/inlineClasses/propertyLoweringOrder.kt index 8534962caac..2e798534713 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyLoweringOrder.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyLoweringOrder.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME // FILE: 1.kt -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class A(val x: String) fun accessProperty(y: B): A { diff --git a/compiler/testData/codegen/box/inlineClasses/referToPropertyInCompanionObjectOfInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/referToPropertyInCompanionObjectOfInlineClass.kt index 13abb479d62..e1bec734d35 100644 --- a/compiler/testData/codegen/box/inlineClasses/referToPropertyInCompanionObjectOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/referToPropertyInCompanionObjectOfInlineClass.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val c: Char) { companion object { val prop = "O" diff --git a/compiler/testData/codegen/box/inlineClasses/referToUnderlyingPropertyInsideInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/referToUnderlyingPropertyInsideInlineClass.kt index 1b81aef59cf..111b6cf2d70 100644 --- a/compiler/testData/codegen/box/inlineClasses/referToUnderlyingPropertyInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/referToUnderlyingPropertyInsideInlineClass.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(val value: Int) { operator fun plus(other: UInt) = UInt(value + other.value) fun otherValue(other: UInt) = other.value diff --git a/compiler/testData/codegen/box/inlineClasses/referToUnderlyingPropertyOfInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/referToUnderlyingPropertyOfInlineClass.kt index 28b7ec30b46..4839b92dc84 100644 --- a/compiler/testData/codegen/box/inlineClasses/referToUnderlyingPropertyOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/referToUnderlyingPropertyOfInlineClass.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(val value: Int) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/removeInInlineCollectionOfInlineClassAsInt.kt b/compiler/testData/codegen/box/inlineClasses/removeInInlineCollectionOfInlineClassAsInt.kt index 6731d2edb6f..b0bd0c5c29a 100644 --- a/compiler/testData/codegen/box/inlineClasses/removeInInlineCollectionOfInlineClassAsInt.kt +++ b/compiler/testData/codegen/box/inlineClasses/removeInInlineCollectionOfInlineClassAsInt.kt @@ -1,14 +1,17 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z2(val x: Z) fun z2(x: Int) = Z2(Z(x)) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class ZMutableCollection(private val ms: MutableCollection) : MutableCollection { override fun add(element: Z): Boolean = ms.add(element) override fun addAll(elements: Collection): Boolean = ms.addAll(elements) @@ -23,7 +26,8 @@ value class ZMutableCollection(private val ms: MutableCollection) : MutableCo override fun isEmpty(): Boolean = ms.isEmpty() } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z2MutableCollection(private val ms: MutableCollection) : MutableCollection { override fun add(element: Z2): Boolean = ms.add(element) override fun addAll(elements: Collection): Boolean = ms.addAll(elements) diff --git a/compiler/testData/codegen/box/inlineClasses/result.kt b/compiler/testData/codegen/box/inlineClasses/result.kt index 4d6aec4f6e6..dc1e4db9c69 100644 --- a/compiler/testData/codegen/box/inlineClasses/result.kt +++ b/compiler/testData/codegen/box/inlineClasses/result.kt @@ -6,7 +6,8 @@ // FILE: result.kt package kotlin -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Result(val value: Any?) // FILE: box.kt diff --git a/compiler/testData/codegen/box/inlineClasses/resultRunCatchingOrElse.kt b/compiler/testData/codegen/box/inlineClasses/resultRunCatchingOrElse.kt index 8b5fb25ec81..3d1ef182953 100644 --- a/compiler/testData/codegen/box/inlineClasses/resultRunCatchingOrElse.kt +++ b/compiler/testData/codegen/box/inlineClasses/resultRunCatchingOrElse.kt @@ -3,7 +3,8 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Result(val value: Any?) { fun exceptionOrNull(): Throwable? = when (value) { diff --git a/compiler/testData/codegen/box/inlineClasses/safeAsOfTypeParameterWithInlineClassBound.kt b/compiler/testData/codegen/box/inlineClasses/safeAsOfTypeParameterWithInlineClassBound.kt index 1514cfa4eb3..e0274d2449e 100644 --- a/compiler/testData/codegen/box/inlineClasses/safeAsOfTypeParameterWithInlineClassBound.kt +++ b/compiler/testData/codegen/box/inlineClasses/safeAsOfTypeParameterWithInlineClassBound.kt @@ -2,7 +2,8 @@ // WITH_RUNTIME interface X -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val value: Int) : X fun test(t: T) where T : X, T : Z = t as? Int diff --git a/compiler/testData/codegen/box/inlineClasses/secondaryConstructorWithVararg.kt b/compiler/testData/codegen/box/inlineClasses/secondaryConstructorWithVararg.kt index 78641a06e94..6ee59638848 100644 --- a/compiler/testData/codegen/box/inlineClasses/secondaryConstructorWithVararg.kt +++ b/compiler/testData/codegen/box/inlineClasses/secondaryConstructorWithVararg.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Z(val x: Int) { constructor(vararg ys: Long) : this(ys.size) } diff --git a/compiler/testData/codegen/box/inlineClasses/secondaryConstructorsInsideInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/secondaryConstructorsInsideInlineClass.kt index b91fc0b122e..0ada043f7b7 100644 --- a/compiler/testData/codegen/box/inlineClasses/secondaryConstructorsInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/secondaryConstructorsInsideInlineClass.kt @@ -4,7 +4,8 @@ var global = "wrong" -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val x: String) { constructor(y: Int) : this(y.toString()) constructor(z: Long) : this(z.toInt() + 1) diff --git a/compiler/testData/codegen/box/inlineClasses/secondaryConstructorsInsideInlineClassWithPrimitiveCarrierType.kt b/compiler/testData/codegen/box/inlineClasses/secondaryConstructorsInsideInlineClassWithPrimitiveCarrierType.kt index 7388b67992d..a1d47118dbf 100644 --- a/compiler/testData/codegen/box/inlineClasses/secondaryConstructorsInsideInlineClassWithPrimitiveCarrierType.kt +++ b/compiler/testData/codegen/box/inlineClasses/secondaryConstructorsInsideInlineClassWithPrimitiveCarrierType.kt @@ -2,7 +2,8 @@ var global = "wrong" -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val x: Int) { constructor(y: String) : this(y.length) diff --git a/compiler/testData/codegen/box/inlineClasses/simpleSecondaryConstructor.kt b/compiler/testData/codegen/box/inlineClasses/simpleSecondaryConstructor.kt index cbf1f5ebd67..58f63172de1 100644 --- a/compiler/testData/codegen/box/inlineClasses/simpleSecondaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/simpleSecondaryConstructor.kt @@ -6,7 +6,8 @@ @file:Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_INLINE_CLASS") -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val x: String) { constructor(y: Int) : this("OK") { if (y == 0) return throw java.lang.IllegalArgumentException() diff --git a/compiler/testData/codegen/box/inlineClasses/smartCastOnThisOfInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/smartCastOnThisOfInlineClassType.kt index 9f09356580c..ff1e35cc4c2 100644 --- a/compiler/testData/codegen/box/inlineClasses/smartCastOnThisOfInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/smartCastOnThisOfInlineClassType.kt @@ -10,7 +10,8 @@ interface IFoo : IBase { fun testDefault2() = if (this is B) this.foo() else "fail" } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class B(val x: String) : IFoo { override fun foo() = x } diff --git a/compiler/testData/codegen/box/inlineClasses/stringPlus.kt b/compiler/testData/codegen/box/inlineClasses/stringPlus.kt index 9727f1e5b16..777b13d8fb0 100644 --- a/compiler/testData/codegen/box/inlineClasses/stringPlus.kt +++ b/compiler/testData/codegen/box/inlineClasses/stringPlus.kt @@ -2,7 +2,8 @@ fun foo(a: IC): T = a.value as T -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: String) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/toStringCallingPrivateFun.kt b/compiler/testData/codegen/box/inlineClasses/toStringCallingPrivateFun.kt index c9f01b66649..67e8f7db600 100644 --- a/compiler/testData/codegen/box/inlineClasses/toStringCallingPrivateFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/toStringCallingPrivateFun.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val x: String) { private fun privateFun() = x override fun toString() = privateFun() diff --git a/compiler/testData/codegen/box/inlineClasses/toStringOfUnboxedNullable.kt b/compiler/testData/codegen/box/inlineClasses/toStringOfUnboxedNullable.kt index f38fc8fad91..91d65b9dfa5 100644 --- a/compiler/testData/codegen/box/inlineClasses/toStringOfUnboxedNullable.kt +++ b/compiler/testData/codegen/box/inlineClasses/toStringOfUnboxedNullable.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME // IGNORE_BACKEND: JVM // IGNORE_LIGHT_ANALYSIS -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val x: String) fun IC?.foo() = toString() // `IC?` unboxed into `String?` diff --git a/compiler/testData/codegen/box/inlineClasses/typeChecksForInlineClasses.kt b/compiler/testData/codegen/box/inlineClasses/typeChecksForInlineClasses.kt index 7dcfdcb33e6..2b6d38615b7 100644 --- a/compiler/testData/codegen/box/inlineClasses/typeChecksForInlineClasses.kt +++ b/compiler/testData/codegen/box/inlineClasses/typeChecksForInlineClasses.kt @@ -1,13 +1,15 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class AsAny(val a: Any?) { fun myEq(other: Any?): Boolean { return other is AsAny && other.a == a } } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class AsInt(val a: Int) { fun myEq(other: Any?): Boolean { return other is AsInt && other.a == a diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/any.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/any.kt index 7545a29866a..7dd6a1e98a7 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/any.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/any.kt @@ -28,7 +28,8 @@ fun bar(value: T, f: FunIFace): R { return f.call(value) } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Any) { fun dispatchValue(): T = value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/anyN.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/anyN.kt index 3b299921905..a3d74ef3803 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/anyN.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/anyN.kt @@ -28,7 +28,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Any?) { fun dispatchValue(): T = value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/iface.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/iface.kt index 2ea9e73a76c..a0b4c72609b 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/iface.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/iface.kt @@ -32,7 +32,8 @@ interface Foo class FooHolder(val value: Any): Foo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Foo): Foo { fun dispatchValue(): T = (value as FooHolder).value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/ifaceChild.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/ifaceChild.kt index 48925807d1d..cda889a396d 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/ifaceChild.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/ifaceChild.kt @@ -32,7 +32,8 @@ interface Foo class FooHolder(val value: Any): Foo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: FooHolder): Foo { fun dispatchValue(): T = (value as FooHolder).value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/primitive.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/primitive.kt index ffa674b5eb6..8f8102ac6f4 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/primitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/primitive.kt @@ -20,7 +20,8 @@ fun IC.extensionValue(): T6 = value as T6 fun normalValue(ic: IC): T7 = ic.value as T7 -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Int) { fun dispatchValue(): T8 = value as T8 } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/resultAny.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/resultAny.kt index 4e04f2f9a89..3e626282753 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/resultAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/resultAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Any) fun foo(a: Result, ic: IC): Pair = bar(a, ic) { a, ic -> diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/string.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/string.kt index 75d17959660..aa4a15fdf93 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/string.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/string.kt @@ -28,7 +28,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: String) { fun dispatchValue(): T = value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/any.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/any.kt index 24e0edf6f8f..7e0690b2967 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/any.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/any.kt @@ -24,7 +24,8 @@ fun bar(value: T, f: (T) -> R): R { return f(value) } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Any) { fun dispatchValue(): T = value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/anyN.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/anyN.kt index 3b3d3e1dc57..4fe2ba5069e 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/anyN.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/anyN.kt @@ -24,7 +24,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Any?) { fun dispatchValue(): T = value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/iface.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/iface.kt index c91568f8cf8..34dd9df97af 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/iface.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/iface.kt @@ -28,7 +28,8 @@ interface Foo class FooHolder(val value: Any): Foo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Foo): Foo { fun dispatchValue(): T = (value as FooHolder).value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/ifaceChild.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/ifaceChild.kt index 825a6e3cd3a..e37bde7fa92 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/ifaceChild.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/ifaceChild.kt @@ -28,7 +28,8 @@ interface Foo class FooHolder(val value: Any): Foo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: FooHolder): Foo { fun dispatchValue(): T = (value as FooHolder).value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/primitive.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/primitive.kt index 26e2633391d..ad0634d4228 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/primitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/primitive.kt @@ -24,7 +24,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Int) { fun dispatchValue(): T = value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/resultAny.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/resultAny.kt index 1a0c5da866c..e4a257120a3 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/resultAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/resultAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Any) fun foo(a: Result, ic: IC): Pair = bar(a, ic) { a, ic -> diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/string.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/string.kt index 2afdf0df209..58008b1edf3 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/string.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/string.kt @@ -24,7 +24,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: String) { fun dispatchValue(): T = value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/any.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/any.kt index f1aa528b256..f5133552b9b 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/any.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/any.kt @@ -28,7 +28,8 @@ fun bar(value: T, f: IFace): R { return f.call(value) } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Any) { fun dispatchValue(): T = value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/anyN.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/anyN.kt index 64765d03542..f1f2078743e 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/anyN.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/anyN.kt @@ -28,7 +28,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Any?) { fun dispatchValue(): T = value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/iface.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/iface.kt index 4cd031f919c..9089d933d26 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/iface.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/iface.kt @@ -32,7 +32,8 @@ interface Foo class FooHolder(val value: Any): Foo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Foo): Foo { // fun dispatchValue(): T = (value as FooHolder).value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/ifaceChild.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/ifaceChild.kt index 070f892832e..6f6a9671841 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/ifaceChild.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/ifaceChild.kt @@ -32,7 +32,8 @@ interface Foo class FooHolder(val value: Any): Foo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: FooHolder): Foo { fun dispatchValue(): T = (value as FooHolder).value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/primitive.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/primitive.kt index dbf83ea60e2..a66ade1575c 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/primitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/primitive.kt @@ -28,7 +28,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Int) { fun dispatchValue(): T = value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/resultAny.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/resultAny.kt index b31b2f066c8..5105b221dbd 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/resultAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/resultAny.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: Any) fun foo(a: Result, ic: IC): Pair = bar(a, ic, object : IFace, IC, Pair> { diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/string.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/string.kt index 03e5dfc601b..6c7b38edc06 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/string.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/string.kt @@ -28,7 +28,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val value: String) { fun dispatchValue(): T = value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt index e4f510e04e3..b55fdecb4ad 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt @@ -6,13 +6,16 @@ class BoxFoo(val boxed: IFoo?) interface IFoo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str(val value: String) : IFoo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Str2(val value: Str): IFoo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class StrArr(val value: Array): IFoo fun boxToTypeParameter(x: Str?) = BoxT(x) diff --git a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt index b1d2b8f0e6d..f0bb6438717 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt @@ -6,7 +6,8 @@ class BoxFoo(val boxed: IFoo?) interface IFoo -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class I32(val value: Int) : IFoo fun boxToTypeParameter(x: I32?) = BoxT(x) diff --git a/compiler/testData/codegen/box/inlineClasses/unboxParameterOfSuspendLambdaBeforeInvoke.kt b/compiler/testData/codegen/box/inlineClasses/unboxParameterOfSuspendLambdaBeforeInvoke.kt index ee97f623005..738519dd249 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxParameterOfSuspendLambdaBeforeInvoke.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxParameterOfSuspendLambdaBeforeInvoke.kt @@ -9,15 +9,18 @@ import helpers.* import kotlin.coroutines.* import kotlin.coroutines.intrinsics.* -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class BoxAny(val value: Any?) { val intValue: Int get() = value as Int } -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class BoxInt(val value: Int) -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class BoxLong(val value: Long) class EmptyContinuation : Continuation { diff --git a/compiler/testData/codegen/box/inlineClasses/unboxReceiverOnCallingMethodFromInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/unboxReceiverOnCallingMethodFromInlineClass.kt index 7010ef6bd3c..89bd7517e7c 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxReceiverOnCallingMethodFromInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxReceiverOnCallingMethodFromInlineClass.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val s: Any) { fun isString(): Boolean = s is String } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxValueFromPlatformType.kt b/compiler/testData/codegen/box/inlineClasses/unboxValueFromPlatformType.kt index 84a97f90f6a..41462138dce 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxValueFromPlatformType.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxValueFromPlatformType.kt @@ -1,7 +1,8 @@ // WITH_RUNTIME // IGNORE_BACKEND: NATIVE -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class SnekDirection(val direction: Int) { companion object { val Up = SnekDirection(0) diff --git a/compiler/testData/codegen/box/inlineClasses/unboxValueOfAnyBeforeMethodInvocation.kt b/compiler/testData/codegen/box/inlineClasses/unboxValueOfAnyBeforeMethodInvocation.kt index ed91a19edc9..00fcccb4703 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxValueOfAnyBeforeMethodInvocation.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxValueOfAnyBeforeMethodInvocation.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class NullableInt(private val holder: Any?) { val intValue: Int get() = holder as Int } diff --git a/compiler/testData/codegen/box/inlineClasses/useInlineClassesInsideElvisOperator.kt b/compiler/testData/codegen/box/inlineClasses/useInlineClassesInsideElvisOperator.kt index 9356a87827e..c949522be70 100644 --- a/compiler/testData/codegen/box/inlineClasses/useInlineClassesInsideElvisOperator.kt +++ b/compiler/testData/codegen/box/inlineClasses/useInlineClassesInsideElvisOperator.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(private val u: Int) { fun asResult() = u } diff --git a/compiler/testData/codegen/box/inlineClasses/useInlineFunctionInsideInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/useInlineFunctionInsideInlineClass.kt index 8d00bf20f43..177d079e046 100644 --- a/compiler/testData/codegen/box/inlineClasses/useInlineFunctionInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/useInlineFunctionInsideInlineClass.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class Foo(val a: String) { fun test(): String { return a + inlineFun() diff --git a/compiler/testData/codegen/box/inlineClasses/useOfInlineClassWithGenericMethodFromJava.kt b/compiler/testData/codegen/box/inlineClasses/useOfInlineClassWithGenericMethodFromJava.kt index fee4b1fa870..a14bcab42c3 100644 --- a/compiler/testData/codegen/box/inlineClasses/useOfInlineClassWithGenericMethodFromJava.kt +++ b/compiler/testData/codegen/box/inlineClasses/useOfInlineClassWithGenericMethodFromJava.kt @@ -3,7 +3,8 @@ // FILE: a.kt -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class IC(val v: Int) { fun getT(): T? = null } diff --git a/compiler/testData/codegen/box/inlineClasses/useThisInsideInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/useThisInsideInlineClass.kt index da8592f67ca..33552076b91 100644 --- a/compiler/testData/codegen/box/inlineClasses/useThisInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/useThisInsideInlineClass.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class UInt(val a: Int) { fun test() { takeNullable(this) diff --git a/compiler/testData/codegen/box/inlineClasses/whenWithSubject.kt b/compiler/testData/codegen/box/inlineClasses/whenWithSubject.kt index 58feab6df6a..c2c2b1a982e 100644 --- a/compiler/testData/codegen/box/inlineClasses/whenWithSubject.kt +++ b/compiler/testData/codegen/box/inlineClasses/whenWithSubject.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -@JvmInline +@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") +@kotlin.jvm.JvmInline value class InlineLong(val value: Long) inline val Number.toInlineLong get() = InlineLong(this.toLong())