diff --git a/compiler/testData/codegen/box/inlineClasses/UIntArraySortExample.kt b/compiler/testData/codegen/box/inlineClasses/UIntArraySortExample.kt index b3e9d72ba18..bcb6651730e 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 -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class UInt(private val value: Int) : Comparable { +@JvmInline +value class UInt(private val value: Int) : Comparable { companion object { private const val INT_MASK = 0xffffffffL } @@ -21,7 +22,8 @@ inline class UInt(private val value: Int) : Comparable { value xor Int.MIN_VALUE } -inline class UIntArray(private val intArray: IntArray) { +@JvmInline +value class UIntArray(private val intArray: IntArray) { val size: Int get() = intArray.size operator fun get(index: Int): UInt = UInt(intArray[index]) @@ -33,7 +35,8 @@ inline class UIntArray(private val intArray: IntArray) { operator fun iterator(): UIntIterator = UIntIterator(intArray.iterator()) } -inline class UIntIterator(private val intIterator: IntIterator) : Iterator { +@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 49255d3f930..18d6c9ca286 100644 --- a/compiler/testData/codegen/box/inlineClasses/annotatedMemberExtensionProperty.kt +++ b/compiler/testData/codegen/box/inlineClasses/annotatedMemberExtensionProperty.kt @@ -1,7 +1,10 @@ +// WITH_RUNTIME + @Target(AnnotationTarget.PROPERTY) annotation class Anno -inline class Z(val s: String) +@JvmInline +value class Z(val s: String) class A { @Anno diff --git a/compiler/testData/codegen/box/inlineClasses/anySuperCall.kt b/compiler/testData/codegen/box/inlineClasses/anySuperCall.kt index 3c62f948f1d..b2a57039433 100644 --- a/compiler/testData/codegen/box/inlineClasses/anySuperCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/anySuperCall.kt @@ -1,7 +1,8 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME // IGNORE_BACKEND: JVM -inline class A(val x: Int) { +@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 bdb86ee439d..3adb247bf69 100644 --- a/compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt +++ b/compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt @@ -1,18 +1,22 @@ // WITH_RUNTIME -inline class IcInt(val i: Int) { +@JvmInline +value class IcInt(val i: Int) { fun simple(): String = i.toString() } -inline class IcLong(val l: Long) { +@JvmInline +value class IcLong(val l: Long) { fun simple(): String = l.toString() } -inline class IcAny(val a: Any?) { +@JvmInline +value class IcAny(val a: Any?) { fun simple(): String = a?.toString() ?: "null" } -inline class IcOverIc(val o: IcLong) { +@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 b611c6c83cc..a26d10f0cb9 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInSecondaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInSecondaryConstructor.kt @@ -1,4 +1,7 @@ -inline class IC private constructor(val i: Int) { +// WITH_RUNTIME + +@JvmInline +value class IC private constructor(val i: Int) { @Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_INLINE_CLASS") constructor() : this(0) { counter += 1 diff --git a/compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInitBlock.kt b/compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInitBlock.kt index f225a5e7f76..c0c77e82a27 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInitBlock.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInitBlock.kt @@ -1,5 +1,7 @@ +// WITH_RUNTIME -inline class IC(val i: Int) { +@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 e1b5b4b082c..3125f7ec80b 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxNullableForFakeOverride.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxNullableForFakeOverride.kt @@ -1,9 +1,11 @@ +// WITH_RUNTIME // IGNORE_BACKEND: JVM abstract class C { fun foo(v: T?, x: (T) -> Any?) = v?.let { x(it) } } -inline class V(val value: Any?) +@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 1a79022a471..92254be3900 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME class BoxT(val boxed: T) class BoxAny(val boxed: Any?) @@ -6,11 +6,14 @@ class BoxFoo(val boxed: IFoo?) interface IFoo -inline class Str(val value: String) : IFoo +@JvmInline +value class Str(val value: String) : IFoo -inline class Str2(val value: Str): IFoo +@JvmInline +value class Str2(val value: Str): IFoo -inline class StrArr(val value: Array): IFoo +@JvmInline +value class StrArr(val value: Array): IFoo fun boxToTypeParameter(x: Str?) = BoxT(x) fun boxToNullableAny(x: Str?) = BoxAny(x) diff --git a/compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt b/compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt index a8609223df4..2a802d4ef7a 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME class BoxT(val boxed: T) class BoxAny(val boxed: Any?) @@ -6,7 +6,8 @@ class BoxFoo(val boxed: IFoo?) interface IFoo -inline class I32(val value: Int): IFoo +@JvmInline +value class I32(val value: Int): IFoo fun boxToTypeParameter(x: I32?) = BoxT(x) fun boxToNullableAny(x: I32?) = BoxAny(x) diff --git a/compiler/testData/codegen/box/inlineClasses/boxResultInlineClassOfConstructorCall.kt b/compiler/testData/codegen/box/inlineClasses/boxResultInlineClassOfConstructorCall.kt index 3999a3dbff7..d8ca457fd99 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxResultInlineClassOfConstructorCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxResultInlineClassOfConstructorCall.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Result(val a: Any?) +@JvmInline +value class Result(val a: Any?) fun box(): String { val a = Result(1) // valueOf diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxAny.kt index 2fcca105be4..b967b38ada8 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxAny.kt @@ -1,4 +1,7 @@ -inline class X(val x: Any) +// WITH_RUNTIME + +@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 247e4f4b5e6..e3ac9d3804f 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxFunLiteralAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxFunLiteralAny.kt @@ -1,4 +1,7 @@ -inline class X(val x: Any) +// WITH_RUNTIME + +@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 28f28825d14..72fea215034 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxInt.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxInt.kt @@ -1,4 +1,7 @@ -inline class X(val x: Int) +// WITH_RUNTIME + +@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 b92a6780c66..f232609c279 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAny.kt @@ -1,4 +1,7 @@ -inline class X(val x: Any?) +// WITH_RUNTIME + +@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 dabc31f2a9f..36a212f35ff 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAnyNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableAnyNull.kt @@ -1,4 +1,7 @@ -inline class X(val x: Any?) +// WITH_RUNTIME + +@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 8bdbf9f4420..3136126f4a9 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableInt.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableInt.kt @@ -1,4 +1,7 @@ -inline class X(val x: Int?) +// WITH_RUNTIME + +@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 048dcde82a3..037cda88445 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableIntNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableIntNull.kt @@ -1,4 +1,7 @@ -inline class X(val x: Int?) +// WITH_RUNTIME + +@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 e8e44e226c1..0f0b1ee325c 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableString.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableString.kt @@ -1,4 +1,7 @@ -inline class X(val x: String?) +// WITH_RUNTIME + +@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 1f5c260e7ff..d137ff36972 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableStringNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxNullableStringNull.kt @@ -1,4 +1,7 @@ -inline class X(val x: String?) +// WITH_RUNTIME + +@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 3cfed167708..8794b994979 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxString.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueInLambda/boxString.kt @@ -1,4 +1,7 @@ -inline class X(val x: String) +// WITH_RUNTIME + +@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 940e50c8f1e..7c69e70a15f 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/boxReturnValueInDefaultMethod.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/boxReturnValueInDefaultMethod.kt @@ -1,11 +1,13 @@ // IGNORE_BACKEND: JVM +// WITH_RUNTIME interface X { operator fun plus(n: Int) : T fun next(): T = this + 1 } -inline class A(val value: Int) : X { +@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 ada2a4798e8..5f75f61e50c 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideChainErasedToAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideChainErasedToAny.kt @@ -1,5 +1,7 @@ +// WITH_RUNTIME -inline class X(val x: Any) +@JvmInline +value class X(val x: Any) interface IBar { fun bar(): Any diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideChainErasedToNullableAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideChainErasedToNullableAny.kt index 6b03919ece9..bf852bdf188 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideChainErasedToNullableAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideChainErasedToNullableAny.kt @@ -1,5 +1,7 @@ +// WITH_RUNTIME -inline class X(val x: Any?) +@JvmInline +value class X(val x: Any?) interface IBar { fun bar(): Any diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToAny.kt index d2d1b4cf4b3..44f6030dd81 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToAny.kt @@ -1,5 +1,7 @@ +// WITH_RUNTIME -inline class X(val x: Any) +@JvmInline +value class X(val x: Any) interface IFoo { fun foo(): Any diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToInterface.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToInterface.kt index 3b975f73173..d2212057d63 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToInterface.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToInterface.kt @@ -1,9 +1,11 @@ +// WITH_RUNTIME interface IFoo { fun foo(): String } -inline class ICFoo(val t: IFoo): IFoo { +@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 9b7869df701..96802f42831 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToPrimitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideErasedToPrimitive.kt @@ -1,5 +1,7 @@ +// WITH_RUNTIME -inline class X(val x: Char) +@JvmInline +value class X(val x: Char) interface IFoo { fun foo(): Any diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideListVsMutableList.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideListVsMutableList.kt index 1ff14dfeb7a..61a503e746d 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 } -inline class AL(val t: MutableList) : MutableList { +@JvmInline +value class AL(val t: MutableList) : MutableList { override val size: Int get() = t.size override fun get(index: Int): String = t.get(index) override fun set(index: Int, element: String): String = t.set(index, element) diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideUnrelatedInterfaces.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideUnrelatedInterfaces.kt index dfe83aeb765..a2e9eb202a9 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideUnrelatedInterfaces.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/covariantOverrideUnrelatedInterfaces.kt @@ -1,8 +1,10 @@ +// WITH_RUNTIME interface IQ1 interface IQ2 -inline class X(val x: Any): IQ1, IQ2 +@JvmInline +value class X(val x: Any): IQ1, IQ2 interface IFoo1 { fun foo(): IQ1 diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverride.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverride.kt index e73747c0f68..548bfeb58bf 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverride.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverride.kt @@ -1,4 +1,7 @@ -inline class X(val x: Any) +// WITH_RUNTIME + +@JvmInline +value class X(val x: Any) interface IFoo { fun foo(): T diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverrideSpecialized.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverrideSpecialized.kt index f4866cb4e7d..e8b1b99f7a2 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverrideSpecialized.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/genericOverrideSpecialized.kt @@ -1,3 +1,5 @@ +// WITH_RUNTIME + interface GFoo { fun foo(): T } @@ -8,7 +10,8 @@ interface IBar { interface SFooBar : GFoo -inline class X(val x: String) : IBar { +@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 320216a6838..1a6f837ec16 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/inlineClassInOverriddenReturnTypes.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/inlineClassInOverriddenReturnTypes.kt @@ -1,5 +1,7 @@ +// WITH_RUNTIME -inline class X(val x: String) +@JvmInline +value class X(val x: String) interface IFoo1 { fun foo(x: T): X diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt28483.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt28483.kt index 33b3da1c8ae..52e86e16050 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt28483.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt28483.kt @@ -1,4 +1,7 @@ -inline class ResultOrClosed(val x: Any?) +// WITH_RUNTIME + +@JvmInline +value class ResultOrClosed(val x: Any?) interface A { fun foo(): T diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt31585.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt31585.kt index 34ed6f1e1a5..4c9f236b5aa 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 -inline class FieldValue(val value: String) +@JvmInline +value class FieldValue(val value: String) enum class RequestFields { ENUM_ONE diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt35234.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt35234.kt index 2d0035ac9c2..c23592ef3b3 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 -inline class NumberInlineClass(val value: Double) +@JvmInline +value class NumberInlineClass(val value: Double) interface TypeAdapter { fun decode(string: FROM): TO diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt35234a.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/kt35234a.kt index d48a109afbd..4fd03e84668 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 -inline class NumberInlineClass(val value: Double) +@JvmInline +value class NumberInlineClass(val value: Double) interface TypeAdapter { fun decode(string: FROM): TO diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithInlineClass.kt index cd364e0730f..4f6e6f466cb 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithInlineClass.kt @@ -1,10 +1,14 @@ -inline class Marker(val i: Int) +// WITH_RUNTIME + +@JvmInline +value class Marker(val i: Int) interface I { fun foo(i: Marker) : T } -inline class IC(val a: Any) +@JvmInline +value class IC(val a: Any) class C : I { override fun foo(i: Marker): IC = IC("OK") diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullAny.kt index 086eea7d614..589dc7adb82 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullAny.kt @@ -1,4 +1,7 @@ -inline class X(val x: Any) +// WITH_RUNTIME + +@JvmInline +value class X(val x: Any) interface IFoo { fun foo(): T diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAny.kt index 89a80da3218..c08a65ed2a9 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAny.kt @@ -1,4 +1,7 @@ -inline class X(val x: Any?) +// WITH_RUNTIME + +@JvmInline +value class X(val x: Any?) interface IFoo { fun foo(): T diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAnyNull.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAnyNull.kt index e8fe178cc5e..3abef95e819 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAnyNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideGenericWithNullableInlineClassUpperBoundWithNonNullNullableAnyNull.kt @@ -1,7 +1,9 @@ // IGNORE_BACKEND: JS_IR +// WITH_RUNTIME // IGNORE_BACKEND: JS_IR_ES6 -inline class X(val x: Any?) +@JvmInline +value class X(val x: Any?) interface IFoo { fun foo(): T diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullAny.kt index 3ba4ae60863..835c20d5712 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullAny.kt @@ -1,4 +1,7 @@ -inline class X(val x: Any) +// WITH_RUNTIME + +@JvmInline +value class X(val x: Any) interface IFoo { fun foo(): X? diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAny.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAny.kt index 7c92c6439bd..96946e561e3 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAny.kt @@ -1,5 +1,7 @@ +// WITH_RUNTIME -inline class X(val x: Any?) +@JvmInline +value class X(val x: Any?) interface IFoo { fun foo(): X? diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAnyNull.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAnyNull.kt index 86335371e13..77f82ef004a 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAnyNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/overrideNullableInlineClassWithNonNullNullableAnyNull.kt @@ -1,5 +1,7 @@ +// WITH_RUNTIME -inline class X(val x: Any?) +@JvmInline +value class X(val x: Any?) interface IFoo { fun foo(): X? diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes1a.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes1a.kt index 7b585e15161..6b8d7fd2a84 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes1a.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes1a.kt @@ -1,9 +1,11 @@ +// WITH_RUNTIME interface IQ { fun ok(): String } -inline class X(val t: IQ): IQ { +@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 fb47f66964c..60928b23276 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes1b.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes1b.kt @@ -1,9 +1,11 @@ +// WITH_RUNTIME interface IQ { fun ok(): String } -inline class X(val t: IQ): IQ { +@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 8259c6d7370..a380083f115 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes2a.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes2a.kt @@ -1,10 +1,13 @@ +// WITH_RUNTIME + interface IBase interface IQ : IBase { fun ok(): String } -inline class X(val t: IQ): IQ { +@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 cf9125b1d8d..658f3137ce4 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes2b.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/relatedReturnTypes2b.kt @@ -1,10 +1,13 @@ +// WITH_RUNTIME + interface IBase interface IQ : IBase { fun ok(): String } -inline class X(val t: IQ): IQ { +@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 d9c8c559050..25f3bc083dc 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/uncastInlineClassToAnyAndBack.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/uncastInlineClassToAnyAndBack.kt @@ -1,4 +1,7 @@ -inline class X(val x: Any) +// WITH_RUNTIME + +@JvmInline +value class X(val x: Any) interface IFoo { fun foo(): T diff --git a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/unrelatedGenerics.kt b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/unrelatedGenerics.kt index 631fc61d74e..a63e2474f39 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/unrelatedGenerics.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxReturnValueOnOverride/unrelatedGenerics.kt @@ -1,3 +1,5 @@ +// WITH_RUNTIME + interface IFoo1 { fun foo(): T } @@ -6,7 +8,8 @@ interface IFoo2 { fun foo(): T } -inline class X(val x: String) +@JvmInline +value class X(val x: String) class Test : IFoo1, IFoo2 { override fun foo(): X = X("OK") diff --git a/compiler/testData/codegen/box/inlineClasses/boxUnboxInlineClassesWithOperatorsGetSet.kt b/compiler/testData/codegen/box/inlineClasses/boxUnboxInlineClassesWithOperatorsGetSet.kt index b5d071cbb02..1b2c612d4df 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxUnboxInlineClassesWithOperatorsGetSet.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxUnboxInlineClassesWithOperatorsGetSet.kt @@ -1,10 +1,12 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class UInt(private val value: Int) { +@JvmInline +value class UInt(private val value: Int) { fun asInt() = value } -inline class UIntArray(private val intArray: IntArray) { +@JvmInline +value class UIntArray(private val intArray: IntArray) { operator fun get(index: Int): UInt = UInt(intArray[index]) operator fun set(index: Int, value: UInt) { diff --git a/compiler/testData/codegen/box/inlineClasses/boxUnboxOfInlineClassForCapturedVars.kt b/compiler/testData/codegen/box/inlineClasses/boxUnboxOfInlineClassForCapturedVars.kt index df21fa88cf8..f1ca1fe47ef 100644 --- a/compiler/testData/codegen/box/inlineClasses/boxUnboxOfInlineClassForCapturedVars.kt +++ b/compiler/testData/codegen/box/inlineClasses/boxUnboxOfInlineClassForCapturedVars.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class UInt(private val value: Int) { +@JvmInline +value class UInt(private val value: Int) { operator fun plus(other: UInt): UInt = UInt(value + other.asValue()) fun asValue(): Int = value diff --git a/compiler/testData/codegen/box/inlineClasses/bridgeForFunctionReturningInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/bridgeForFunctionReturningInlineClass.kt index 9cb37f7cba4..bf71d9f104c 100644 --- a/compiler/testData/codegen/box/inlineClasses/bridgeForFunctionReturningInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/bridgeForFunctionReturningInlineClass.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class IC(val x: String) +@JvmInline +value class IC(val x: String) interface I { fun foo(): T diff --git a/compiler/testData/codegen/box/inlineClasses/bridgeGenerationWithInlineClassOverAny.kt b/compiler/testData/codegen/box/inlineClasses/bridgeGenerationWithInlineClassOverAny.kt index a81e1b9140a..bb2130af164 100644 --- a/compiler/testData/codegen/box/inlineClasses/bridgeGenerationWithInlineClassOverAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/bridgeGenerationWithInlineClassOverAny.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Result(val a: Any?) { +@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 44f7a15aafd..d2bf80f7ac7 100644 --- a/compiler/testData/codegen/box/inlineClasses/bridgesWhenInlineClassImplementsGenericInterface.kt +++ b/compiler/testData/codegen/box/inlineClasses/bridgesWhenInlineClassImplementsGenericInterface.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class InlinedComparable(val x: Int) : Comparable { +@JvmInline +value class InlinedComparable(val x: Int) : Comparable { override fun compareTo(other: InlinedComparable): Int { return x.compareTo(other.x) } @@ -12,7 +13,8 @@ interface Base { fun Base.foo(a: Base, b: T): Base } -inline class InlinedBase(val x: Int) : Base { +@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 3ba5361784f..c6f3c3df4b6 100644 --- a/compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Props(val intArray: IntArray) { +@JvmInline +value class Props(val intArray: IntArray) { val size get() = intArray.size fun foo(): Int { diff --git a/compiler/testData/codegen/box/inlineClasses/callSpecializedEqualsViaReflection.kt b/compiler/testData/codegen/box/inlineClasses/callSpecializedEqualsViaReflection.kt index 74874963c9e..e9901b09e66 100644 --- a/compiler/testData/codegen/box/inlineClasses/callSpecializedEqualsViaReflection.kt +++ b/compiler/testData/codegen/box/inlineClasses/callSpecializedEqualsViaReflection.kt @@ -2,9 +2,12 @@ // FULL_JDK // TARGET_BACKEND: JVM +// WITH_RUNTIME + import java.lang.reflect.InvocationTargetException -inline class Simple(val x: String) { +@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 79c9e9218b0..1491016d7de 100644 --- a/compiler/testData/codegen/box/inlineClasses/callSpeciallyOverriddenPropertyOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/callSpeciallyOverriddenPropertyOfInlineClass.kt @@ -1,9 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME // TARGET_BACKEND: JVM -inline class UInt(val x: Int) +@JvmInline +value class UInt(val x: Int) -inline class UIntArray(private val storage: IntArray) : Collection { +@JvmInline +value class UIntArray(private val storage: IntArray) : Collection { public override val size: Int get() = storage.size override operator fun iterator() = TODO() diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt index ec97a9b91a8..79dd9f5455f 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt @@ -1,9 +1,11 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) -inline class L(val x: Long) -inline class S(val x: String) +@JvmInline +value class Z(val x: Int) +@JvmInline +value class L(val x: Long) +@JvmInline +value class S(val x: String) fun Z.test() = x fun L.test() = x diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt index f2c4757e960..06de9b0d5b6 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt @@ -1,9 +1,11 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) -inline class L(val x: Long) -inline class S(val x: String) +@JvmInline +value class Z(val x: Int) +@JvmInline +value class L(val x: Long) +@JvmInline +value class S(val x: String) val Z.xx get() = x val L.xx get() = x diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt index 465845d7c71..f3b4714f714 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt @@ -1,15 +1,17 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) { +@JvmInline +value class Z(val x: Int) { fun test() = x } -inline class L(val x: Long) { +@JvmInline +value class L(val x: Long) { fun test() = x } -inline class S(val x: String) { +@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 29a89e3ede5..65d3e00809c 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt @@ -1,15 +1,17 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) { +@JvmInline +value class Z(val x: Int) { val xx get() = x } -inline class L(val x: Long) { +@JvmInline +value class L(val x: Long) { val xx get() = x } -inline class S(val x: String) { +@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 1c1dd71e21e..f2f4f837a4f 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt @@ -1,9 +1,11 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) -inline class L(val x: Long) -inline class S(val x: String) +@JvmInline +value class Z(val x: Int) +@JvmInline +value class L(val x: Long) +@JvmInline +value class S(val x: String) fun box(): String { if (Z(42)::x.get() != 42) throw AssertionError() diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/constructorWithInlineClassParameters.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/constructorWithInlineClassParameters.kt index 329ee0c376e..89245836b2d 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/constructorWithInlineClassParameters.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/constructorWithInlineClassParameters.kt @@ -1,8 +1,8 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME import kotlin.test.assertEquals -inline class Z(val x: Int) +@JvmInline +value class Z(val x: Int) class Outer(val z1: Z) { inner class Inner(val z2: Z) diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/equalsHashCodeToString.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/equalsHashCodeToString.kt index d6301279ac4..67f74830238 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/equalsHashCodeToString.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/equalsHashCodeToString.kt @@ -2,9 +2,12 @@ // WASM_MUTE_REASON: IGNORED_IN_JS // IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE // WITH_REFLECT +// WITH_RUNTIME + import kotlin.test.* -inline class Z(val s: String) +@JvmInline +value class Z(val s: String) fun box(): String { val a = Z("a") diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt index 4d926fe3611..7e5f60c84f8 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt @@ -1,9 +1,11 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) -inline class L(val x: Long) -inline class S(val x: String) +@JvmInline +value class Z(val x: Int) +@JvmInline +value class L(val x: Long) +@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 1d5ba6d0e2f..f7212f30173 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt @@ -1,9 +1,11 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) -inline class L(val x: Long) -inline class S(val x: String) +@JvmInline +value class Z(val x: Int) +@JvmInline +value class L(val x: Long) +@JvmInline +value class S(val x: String) fun Z.test() = x fun L.test() = x diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt index 7db8b64f40a..4c432d86636 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt @@ -1,9 +1,11 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) -inline class L(val x: Long) -inline class S(val x: String) +@JvmInline +value class Z(val x: Int) +@JvmInline +value class L(val x: Long) +@JvmInline +value class S(val x: String) val Z.xx get() = x val L.xx get() = x diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt index c7477995ee7..44446c8a5bb 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt @@ -1,10 +1,12 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME import kotlin.test.assertEquals -inline class Z(internal val x: Int) -inline class L(internal val x: Long) -inline class S(internal val x: String) +@JvmInline +value class Z(internal val x: Int) +@JvmInline +value class L(internal val x: Long) +@JvmInline +value class S(internal val x: String) fun box(): String { assertEquals(42, Z::x.get(Z(42))) diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt index 075cb639c90..75fec558530 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt @@ -1,15 +1,17 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) { +@JvmInline +value class Z(val x: Int) { fun test() = x } -inline class L(val x: Long) { +@JvmInline +value class L(val x: Long) { fun test() = x } -inline class S(val x: String) { +@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 3382c4148f3..b92b57532db 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt @@ -1,15 +1,17 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) { +@JvmInline +value class Z(val x: Int) { val xx get() = x } -inline class L(val x: Long) { +@JvmInline +value class L(val x: Long) { val xx get() = x } -inline class S(val x: String) { +@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 f41492d012a..cf068028b04 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt @@ -1,9 +1,11 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) -inline class L(val x: Long) -inline class S(val x: String) +@JvmInline +value class Z(val x: Int) +@JvmInline +value class L(val x: Long) +@JvmInline +value class S(val x: String) fun box(): String { if (42.let(::Z).x != 42) throw AssertionError() diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt index e585afa7e4e..d085dec55da 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt @@ -1,9 +1,11 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) -inline class L(val x: Long) -inline class S(val x: String) +@JvmInline +value class Z(val x: Int) +@JvmInline +value class L(val x: Long) +@JvmInline +value class S(val x: String) fun box(): String { if ((Z::x).get(Z(42)) != 42) throw AssertionError() diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt index 142b2b798eb..299eaec6982 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt @@ -1,20 +1,22 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME import kotlin.test.assertEquals -inline class Z(private val x: Int) { +@JvmInline +value class Z(private val x: Int) { companion object { val xref = Z::x } } -inline class L(private val x: Long) { +@JvmInline +value class L(private val x: Long) { companion object { val xref = L::x } } -inline class S(private val x: String) { +@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 a515a3da6c2..6c29a3882f0 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt @@ -1,6 +1,6 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) +@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 17764bb1826..50b0dab835d 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt @@ -1,6 +1,6 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) +@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 e7942b503ce..18b34532736 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt @@ -1,6 +1,6 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) +@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 6a4bd69be76..187b6cdd70e 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/kt37986.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/kt37986.kt @@ -1,4 +1,7 @@ -inline class R(val x: Any) +// WITH_RUNTIME + +@JvmInline +value class R(val x: Any) fun useR(r: R) { if (r.x as String != "OK") throw AssertionError("$r") diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/any.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/any.kt index 349099584df..02f0bfe1551 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/any.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/any.kt @@ -1,4 +1,7 @@ -inline class Value(val value: Any) +// WITH_RUNTIME + +@JvmInline +value class Value(val value: Any) object Foo { fun foo(value: Value) { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/anyN.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/anyN.kt index 005f9cc3776..6b3f84244e1 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/anyN.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/anyN.kt @@ -1,4 +1,7 @@ -inline class Value(val value: Any?) +// WITH_RUNTIME + +@JvmInline +value class Value(val value: Any?) object Foo { fun foo(value: Value) { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/int.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/int.kt index a2248b46499..cf749872bf0 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/int.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/int.kt @@ -1,4 +1,7 @@ -inline class Value(val value: Int) +// WITH_RUNTIME + +@JvmInline +value class Value(val value: Int) object Foo { fun foo(value: Value) { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/intN.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/intN.kt index 8d1411c3761..4a595be4d3a 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/intN.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/intN.kt @@ -1,4 +1,7 @@ -inline class Value(val value: Int?) +// WITH_RUNTIME + +@JvmInline +value class Value(val value: Int?) object Foo { fun foo(value: Value) { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/null.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/null.kt index 85a7775c0e1..67913c2c4e0 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/null.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/null.kt @@ -1,4 +1,7 @@ -inline class Value(val value: Any) +// WITH_RUNTIME + +@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 51f0e68b9a8..587fda30ed5 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/string.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/string.kt @@ -1,4 +1,7 @@ -inline class Value(val value: String) +// WITH_RUNTIME + +@JvmInline +value class Value(val value: String) object Foo { fun foo(value: Value) { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/stringN.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/stringN.kt index 170f6d3cdab..bcfe308cc39 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferences/let/stringN.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/let/stringN.kt @@ -1,4 +1,7 @@ -inline class Value(val value: String?) +// WITH_RUNTIME + +@JvmInline +value class Value(val value: String?) object Foo { fun foo(value: Value) { diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferencesWithInlineClasses.kt b/compiler/testData/codegen/box/inlineClasses/callableReferencesWithInlineClasses.kt index e3e9744f98a..f96dadce614 100644 --- a/compiler/testData/codegen/box/inlineClasses/callableReferencesWithInlineClasses.kt +++ b/compiler/testData/codegen/box/inlineClasses/callableReferencesWithInlineClasses.kt @@ -1,7 +1,8 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME // WITH_REFLECT -inline class Foo(val x: String) { +@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 95700b20a13..bdeb7a95f75 100644 --- a/compiler/testData/codegen/box/inlineClasses/castInsideWhenExpression.kt +++ b/compiler/testData/codegen/box/inlineClasses/castInsideWhenExpression.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Foo(val x: Any) { +@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 e943ffe85eb..0c6733c011e 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxUnboxOfArgumentsOnInlinedFunctions.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxUnboxOfArgumentsOnInlinedFunctions.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Foo(val value: Int) +@JvmInline +value class Foo(val value: Int) fun id(x: T): T = x inline fun inlinedId(x: T): T = x diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxingAfterAssertionOperator.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxingAfterAssertionOperator.kt index a0dd4e81efc..f65e243a7d3 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxingAfterAssertionOperator.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxingAfterAssertionOperator.kt @@ -1,12 +1,15 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class WithPrimitive(val a: Int) +@JvmInline +value class WithPrimitive(val a: Int) fun takeWithPrimitive(a: WithPrimitive) {} -inline class WithReference(val a: Any) +@JvmInline +value class WithReference(val a: Any) fun takeWithReference(a: WithReference) {} -inline class WithNullableReference(val a: Any?) +@JvmInline +value class WithNullableReference(val a: Any?) fun takeWithNullableReference(a: WithNullableReference) {} fun foo(a: WithPrimitive?, b: WithPrimitive) { diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxingForComplexClassHierarchy.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxingForComplexClassHierarchy.kt index 74b0830be73..757aca76086 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxingForComplexClassHierarchy.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxingForComplexClassHierarchy.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class IC(val x: Int) +@JvmInline +value class IC(val x: Int) interface I { fun foo(t: T): T diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxingForNonLocalAndLabeledReturns.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxingForNonLocalAndLabeledReturns.kt index e070320bcda..9b1f98131b6 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxingForNonLocalAndLabeledReturns.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxingForNonLocalAndLabeledReturns.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class ULong(val l: Long) +@JvmInline +value class ULong(val l: Long) fun nonLocal(): ULong? { val u1 = ULong(1) diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxingFromReturnTypeForInlineClasses.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxingFromReturnTypeForInlineClasses.kt index 91ed3590a5b..c44966bce58 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxingFromReturnTypeForInlineClasses.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxingFromReturnTypeForInlineClasses.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Foo(val a: Int) { +@JvmInline +value class Foo(val a: Int) { fun member(): String = "" fun asResult() = a diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxingOnFunctionCalls.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxingOnFunctionCalls.kt index 16f947ff65e..e2d01a2d8e2 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxingOnFunctionCalls.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxingOnFunctionCalls.kt @@ -1,7 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class InlineNotNullPrimitive(val x: Int) -inline class InlineNotNullReference(val y: String) +@JvmInline +value class InlineNotNullPrimitive(val x: Int) +@JvmInline +value class InlineNotNullReference(val y: String) fun testNotNullPrimitive(a: Any, b: T, c: InlineNotNullPrimitive, d: InlineNotNullPrimitive?) {} fun testNotNullReference(a: Any, b: T, c: InlineNotNullReference, d: InlineNotNullReference?) {} diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxingOnLocalVariableAssignments.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxingOnLocalVariableAssignments.kt index 2f7b6a58484..7c72f8d892b 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxingOnLocalVariableAssignments.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxingOnLocalVariableAssignments.kt @@ -1,9 +1,13 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class InlineNotNullPrimitive(val x: Int) -inline class InlineNullablePrimitive(val x: Int?) -inline class InlineNotNullReference(val a: Any) -inline class InlineNullableReference(val a: Any?) +@JvmInline +value class InlineNotNullPrimitive(val x: Int) +@JvmInline +value class InlineNullablePrimitive(val x: Int?) +@JvmInline +value class InlineNotNullReference(val a: Any) +@JvmInline +value class InlineNullableReference(val a: Any?) fun test1(a: InlineNotNullPrimitive) { val a0 = a diff --git a/compiler/testData/codegen/box/inlineClasses/checkBoxingUnboxingForInheritedTypeSpecializedFunctions.kt b/compiler/testData/codegen/box/inlineClasses/checkBoxingUnboxingForInheritedTypeSpecializedFunctions.kt index 1fe479ab9ac..a5cbb757915 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkBoxingUnboxingForInheritedTypeSpecializedFunctions.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkBoxingUnboxingForInheritedTypeSpecializedFunctions.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class IC(val x: Int) +@JvmInline +value class IC(val x: Int) abstract class A { var t: T? = null diff --git a/compiler/testData/codegen/box/inlineClasses/checkCallingMembersInsideInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/checkCallingMembersInsideInlineClass.kt index 804adc8ea96..05d4e6d78a4 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkCallingMembersInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkCallingMembersInsideInlineClass.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Foo(val x: Int) { +@JvmInline +value class Foo(val x: Int) { fun empty() = "" fun withParam(a: String) = a fun withInlineClassParam(f: Foo) = f.toString() diff --git a/compiler/testData/codegen/box/inlineClasses/checkCastToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/checkCastToInlineClass.kt index 52425992af8..18e3d0b8ea9 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkCastToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkCastToInlineClass.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class UInt(val s: Int) +@JvmInline +value class UInt(val s: Int) fun test(a1: Any, a2: UInt?, a3: Any?, a4: Any?): Int { val b1 = a1 as UInt diff --git a/compiler/testData/codegen/box/inlineClasses/checkForInstanceOfInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/checkForInstanceOfInlineClass.kt index eab47359aba..1b029ae824a 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkForInstanceOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkForInstanceOfInlineClass.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class UInt(val u: Int) { +@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 aa3c2d2e1ad..edc43be303c 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkLambdaWithInlineClassesInFunctionalType.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkLambdaWithInlineClassesInFunctionalType.kt @@ -1,7 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class UInt(val value: Int) -inline class ULong(val value: Long) +@JvmInline +value class UInt(val value: Int) +@JvmInline +value class ULong(val value: Long) fun foo(u: UInt, f: (UInt) -> ULong): ULong = f(u) inline fun inlinedFoo(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 53554e42d6b..d8499038d44 100644 --- a/compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt +++ b/compiler/testData/codegen/box/inlineClasses/checkUnboxingResultFromTypeVariable.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Result(val a: Any?) { +@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 525859afd02..a5043e824ef 100644 --- a/compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt +++ b/compiler/testData/codegen/box/inlineClasses/classInInlineClassInit.kt @@ -1,6 +1,9 @@ +// WITH_RUNTIME + var result = "Fail" -inline class A(val value: String) { +@JvmInline +value class A(val value: String) { init { class B { init { diff --git a/compiler/testData/codegen/box/inlineClasses/classLiteralOnInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/classLiteralOnInlineClass.kt index 8122f6b490d..1dad200a5e7 100644 --- a/compiler/testData/codegen/box/inlineClasses/classLiteralOnInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/classLiteralOnInlineClass.kt @@ -1,3 +1,4 @@ +// WITH_RUNTIME // WITH_REFLECT // TARGET_BACKEND: JVM @@ -5,10 +6,14 @@ package root import kotlin.reflect.KClass -inline class IcInt(val x: Int) -inline class IcLong(val l: Long) -inline class IcAny(val a: Any?) -inline class IcOverIc(val o: IcLong) +@JvmInline +value class IcInt(val x: Int) +@JvmInline +value class IcLong(val l: Long) +@JvmInline +value class IcAny(val a: Any?) +@JvmInline +value class IcOverIc(val o: IcLong) fun check(c: KClass<*>, s: String) { if (c.toString() != s) error("Fail, expected: $s, actual: $c") diff --git a/compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt index 5b121fec3ef..18d32d0864c 100644 --- a/compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/computablePropertyInsideInlineClass.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class UIntArray(private val intArray: IntArray) { +@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 20c68440fe2..1489d5c6f90 100644 --- a/compiler/testData/codegen/box/inlineClasses/conformToComparableAndCallInterfaceMethod.kt +++ b/compiler/testData/codegen/box/inlineClasses/conformToComparableAndCallInterfaceMethod.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Foo(val x: Int) : Comparable { +@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 0982077ace4..fc31f92c6f7 100644 --- a/compiler/testData/codegen/box/inlineClasses/constructorCallableReference.kt +++ b/compiler/testData/codegen/box/inlineClasses/constructorCallableReference.kt @@ -9,7 +9,8 @@ interface I { } } -inline class IC(val ok: String = "OK") : I +@JvmInline +value class IC(val ok: String = "OK") : I fun box(): String { return I.default.ok diff --git a/compiler/testData/codegen/box/inlineClasses/constructorImplVisibility.kt b/compiler/testData/codegen/box/inlineClasses/constructorImplVisibility.kt index e7efccb4a1a..14bc88ccbd7 100644 --- a/compiler/testData/codegen/box/inlineClasses/constructorImplVisibility.kt +++ b/compiler/testData/codegen/box/inlineClasses/constructorImplVisibility.kt @@ -4,10 +4,14 @@ import java.lang.reflect.Modifier -inline class IC1 public constructor(val i: Int) -inline class IC11 internal constructor(val i: Int) -inline class IC2 private constructor(val i: Int) -inline class IC4 protected constructor(val i: Int) +@JvmInline +value class IC1 public constructor(val i: Int) +@JvmInline +value class IC11 internal constructor(val i: Int) +@JvmInline +value class IC2 private constructor(val i: Int) +@JvmInline +value class IC4 protected constructor(val i: Int) fun box(): String { if (!Modifier.isPublic(IC1::class.java.declaredMethods.single { it.name == "constructor-impl" }.modifiers)) return "FAIL 1" diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod.kt index c1350b46f34..3172859f6bb 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class R(private val r: Int) { +@JvmInline +value class R(private val r: Int) { fun test() = ok() companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod2.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod2.kt index 80e66d49441..5fa9824a5cd 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod2.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassCompanionMethod2.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class R(private val r: Long) { +@JvmInline +value class R(private val r: Long) { fun test() = ok() companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromCompanion.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromCompanion.kt index 933ee24696b..385ce90b0d4 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromCompanion.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromCompanion.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Composed(val s: String) { +@JvmInline +value class Composed(val s: String) { private constructor(s1: String, s2: String) : this(s1 + s2) companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromLambda.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromLambda.kt index ace1994d15b..43d8b6bb6d2 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromLambda.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassConstructorFromLambda.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Composed(val s: String) { +@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 10ebcebc02c..7581f48915c 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromCompanion.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromCompanion.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class R(private val r: Int) { +@JvmInline +value class R(private val r: Int) { private fun ok() = "OK" companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromCompanion2.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromCompanion2.kt index 88a5c84c882..d88b281c241 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromCompanion2.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromCompanion2.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class R(private val r: Long) { +@JvmInline +value class R(private val r: Long) { private fun ok() = "OK" companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda.kt index 6b3c55b7251..150fd9a2364 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class R(private val r: Int) { +@JvmInline +value class R(private val r: Int) { fun test() = run { ok() } private fun ok() = "OK" diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda2.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda2.kt index 83502984b50..8dde0f73160 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda2.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromInlineLambda2.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class R(private val r: Long) { +@JvmInline +value class R(private val r: Long) { fun test() = run { ok() } private fun ok() = "OK" diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda.kt index c8fe3872c2c..a53cc2adac0 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda.kt @@ -1,8 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun eval(fn: () -> T) = fn() -inline class R(private val r: Int) { +@JvmInline +value class R(private val r: Int) { fun test() = eval { ok() } private fun ok() = "OK" diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda2.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda2.kt index d6553d5f859..ed61bc4bb59 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda2.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateInlineClassMethodFromLambda2.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class R(private val r: Long) { +@JvmInline +value class R(private val r: Long) { fun test() = { ok() }() private fun ok() = "OK" diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateStaticInlineClassCompanionMethod.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateStaticInlineClassCompanionMethod.kt index bfbe3334f9b..d1c1357684f 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateStaticInlineClassCompanionMethod.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/accessPrivateStaticInlineClassCompanionMethod.kt @@ -1,8 +1,8 @@ -// !LANGUAGE: +InlineClasses // TARGET_BACKEND: JVM // WITH_RUNTIME -inline class R(private val r: Int) { +@JvmInline +value class R(private val r: Int) { fun test() = ok() companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda.kt index c8a4c240204..35f93d4c1d9 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class R(private val r: Int) { +@JvmInline +value class R(private val r: Int) { fun test() = { ok() }() fun ok() = "OK" diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda2.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda2.kt index ed1aecda605..6672980c62e 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda2.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInLambda2.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class R(private val r: Long) { +@JvmInline +value class R(private val r: Long) { fun test() = { ok() }() fun ok() = "OK" diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInObject.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInObject.kt index 253fc2aeb54..61be68ba299 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInObject.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/captureInlineClassInstanceInObject.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class R(private val r: Int) { +@JvmInline +value class R(private val r: Int) { fun test() = object { override fun toString() = ok() }.toString() diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/inlineLambdaInInlineClassFun.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/inlineLambdaInInlineClassFun.kt index ee48ba10154..1c2e5cc684a 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/inlineLambdaInInlineClassFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/inlineLambdaInInlineClassFun.kt @@ -1,8 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME inline fun runInline(fn: () -> String) = fn() -inline class R(private val r: Int) { +@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 9af786f282a..a0abcbc45f5 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt26858.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt26858.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Direction(private val direction: Int) { +@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 3d79c3402dd..52524f314ea 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt27513.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt27513.kt @@ -1,7 +1,7 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class A(val b: String) { +@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 5bff6a8fcf5..fbd3140468c 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt30780.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt30780.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Test(val x: Int) { +@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 5cc3e13e978..676bbf3ecf7 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/lambdaInInlineClassFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/lambdaInInlineClassFun.kt @@ -1,8 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun eval(fn: () -> T) = fn() -inline class R(private val r: Int) { +@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 2c827f8df27..79b426f8f1e 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/objectInInlineClassFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/objectInInlineClassFun.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class R(private val r: Int) { +@JvmInline +value class R(private val r: Int) { fun test() = object { override fun toString() = "OK" diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionFun.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionFun.kt index 259b032c86e..8222cdbe4fe 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionFun.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class R(private val r: Int) { +@JvmInline +value class R(private val r: Int) { fun test() = pf() companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionVal.kt b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionVal.kt index ef803e57da9..a4b72f17bda 100644 --- a/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionVal.kt +++ b/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/toPrivateCompanionVal.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class R(private val r: Int) { +@JvmInline +value class R(private val r: Int) { fun test() = pv companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/correctBoxingForBranchExpressions.kt b/compiler/testData/codegen/box/inlineClasses/correctBoxingForBranchExpressions.kt index f805018d1b6..6aa1c55ef58 100644 --- a/compiler/testData/codegen/box/inlineClasses/correctBoxingForBranchExpressions.kt +++ b/compiler/testData/codegen/box/inlineClasses/correctBoxingForBranchExpressions.kt @@ -1,10 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME interface Base { fun result(): Int } -inline class Inlined(val x: Int) : Base { +@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 16d40a585fb..68b7974571b 100644 --- a/compiler/testData/codegen/box/inlineClasses/createInlineClassInArgumentPosition.kt +++ b/compiler/testData/codegen/box/inlineClasses/createInlineClassInArgumentPosition.kt @@ -1,12 +1,14 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class AsInt(val value: Int) { +@JvmInline +value class AsInt(val value: Int) { override fun toString(): String { return "asInt: ${value.toString()}" } } -inline class AsAny(val value: Any) { +@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 fcbb14d9771..81925b14d31 100644 --- a/compiler/testData/codegen/box/inlineClasses/crossinlineWithInlineClassInParameter.kt +++ b/compiler/testData/codegen/box/inlineClasses/crossinlineWithInlineClassInParameter.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Result(val a: Any?) { +@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 b23a90fa9b8..ebac705117d 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 -inline class InlineDouble3(val values: DoubleArray) { +@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 217ee16afbb..c9265608952 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultFunctionsFromAnyForInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultFunctionsFromAnyForInlineClass.kt @@ -1,9 +1,13 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Foo(val x: Int) -inline class FooRef(val y: String) -inline class FooLong(val x: Long) -inline class FooDouble(val y: Double) +@JvmInline +value class Foo(val x: Int) +@JvmInline +value class FooRef(val y: String) +@JvmInline +value class FooLong(val x: Long) +@JvmInline +value class FooDouble(val y: Double) fun box(): String { val f = Foo(42) diff --git a/compiler/testData/codegen/box/inlineClasses/defaultInterfaceMethodsInInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/defaultInterfaceMethodsInInlineClass.kt index cffe5152cc2..92410183a36 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultInterfaceMethodsInInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultInterfaceMethodsInInlineClass.kt @@ -1,9 +1,12 @@ +// WITH_RUNTIME + interface IFoo { fun foo(x: T): String = "O" fun T.bar(): String = "K" } -inline class L(val x: Long) : IFoo +@JvmInline +value class L(val x: Long) : IFoo fun box(): String { val z = L(0L) diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultConstructorParameterValuesOfInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultConstructorParameterValuesOfInlineClassType.kt index 20622f525a1..df9b430bd84 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultConstructorParameterValuesOfInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultConstructorParameterValuesOfInlineClassType.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z(val z: Int) +@JvmInline +value class Z(val z: Int) class Test(val z: Z = Z(42)) { fun test() = z.z diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultInterfaceFunParameterValuesOfInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultInterfaceFunParameterValuesOfInlineClassType.kt index f49bf6532f9..ad01c65b738 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultInterfaceFunParameterValuesOfInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultInterfaceFunParameterValuesOfInlineClassType.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z(val z: Int) +@JvmInline +value class Z(val z: Int) interface ITest { fun testDefault(z: Z = Z(42)) = z.z diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultParameterValuesOfInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultParameterValuesOfInlineClassType.kt index 5b682b2252a..1e855e06d44 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultParameterValuesOfInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultParameterValuesOfInlineClassType.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z(val z: Int) +@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 a7e07d8845b..ef556a58f1b 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultParameterValuesOfInlineClassTypeBoxing.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultParameterValuesOfInlineClassTypeBoxing.kt @@ -1,10 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME interface IFoo { fun foo(): String } -inline class Z(val z: Int) : IFoo { +@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 dfe597c6c94..fe2e597ee7b 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultValueOfInlineClassTypeInInlineFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultValueOfInlineClassTypeInInlineFun.kt @@ -1,9 +1,13 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z(val int: Int) -inline class L(val long: Long) -inline class Str(val string: String) -inline class Obj(val obj: Any) +@JvmInline +value class Z(val int: Int) +@JvmInline +value class L(val long: Long) +@JvmInline +value class Str(val string: String) +@JvmInline +value class Obj(val obj: Any) inline fun withDefaultZ(fn: (Z) -> R, x: Z = Z(42)) = fn(x) inline fun withDefaultL(fn: (L) -> R, x: L = L(42L)) = fn(x) diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultValueOfInlineClassTypeInInlineFunInInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultValueOfInlineClassTypeInInlineFunInInlineClass.kt index 3dc35d83506..54e83c05bd5 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultValueOfInlineClassTypeInInlineFunInInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultValueOfInlineClassTypeInInlineFunInInlineClass.kt @@ -1,11 +1,16 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z(val int: Int) -inline class L(val long: Long) -inline class Str(val string: String) -inline class Obj(val obj: Any) +@JvmInline +value class Z(val int: Int) +@JvmInline +value class L(val long: Long) +@JvmInline +value class Str(val string: String) +@JvmInline +value class Obj(val obj: Any) -inline class Host(val xx: Int) { +@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) inline fun withDefaultL2(x: L = L(xx.toLong()), fn: (L) -> R) = fn(x) diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassFun.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassFun.kt index 72a3ac73439..f1a1bea6be3 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassFun.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z(val x: Int) { +@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 10f7374e78e..c20961bdb3d 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassPrimaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassPrimaryConstructor.kt @@ -1,8 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z(val x: Int = 1234) -inline class L(val x: Long = 1234L) -inline class S(val x: String = "foobar") +@JvmInline +value class Z(val x: Int = 1234) +@JvmInline +value class L(val x: Long = 1234L) +@JvmInline +value class S(val x: String = "foobar") fun box(): String { if (Z().x != 1234) throw AssertionError() diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassPrimaryConstructorWithInlineClassValue.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassPrimaryConstructorWithInlineClassValue.kt index aa9d5033553..74c6b1cf478 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassPrimaryConstructorWithInlineClassValue.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassPrimaryConstructorWithInlineClassValue.kt @@ -1,8 +1,10 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Inner(val result: String) +@JvmInline +value class Inner(val result: String) -inline class A(val inner: Inner = Inner("OK")) +@JvmInline +value class A(val inner: Inner = Inner("OK")) fun box(): String { return A().inner.result diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassSecondaryConstructor.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassSecondaryConstructor.kt index 17789ab1b6d..78bb730ef09 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassSecondaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/inlineClassSecondaryConstructor.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z(val x: Int) { +@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 76add8c9ee2..66927075c78 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt26554.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt26554.kt @@ -1,11 +1,11 @@ // IGNORE_BACKEND: WASM // WASM_MUTE_REASON: STDLIB_GENERATED -// !LANGUAGE: +InlineClasses // WITH_RUNTIME data class RGBA(val rgba: Int) -inline class RgbaArray(val array: IntArray) { +@JvmInline +value class RgbaArray(val array: IntArray) { val size: Int get() = array.size fun fill(value: RGBA, start: Int = 0, end: Int = this.size): Unit = array.fill(value.rgba, start, end) diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt index 63811ef403d..cc93e53f0c4 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val i: Int) { +@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 13015dd6abb..7019533e367 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all-compatibility.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all-compatibility.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME // !JVM_DEFAULT_MODE: all-compatibility // TARGET_BACKEND: JVM @@ -10,7 +10,8 @@ interface Path { fun Int.extension(maxDepth: Int = 42) } -inline class RealPath(val x: Int) : Path { +@JvmInline +value class RealPath(val x: Int) : Path { override fun dispatch(maxDepth: Int) = Unit fun childrenDispatch(recursively: Boolean): Unit = diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all.kt index f71fc05e9a3..c41b06f22dc 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME // !JVM_DEFAULT_MODE: all // TARGET_BACKEND: JVM @@ -10,7 +10,8 @@ interface Path { fun Int.extension(maxDepth: Int = 42) } -inline class RealPath(val x: Int) : Path { +@JvmInline +value class RealPath(val x: Int) : Path { override fun dispatch(maxDepth: Int) = Unit fun childrenDispatch(recursively: Boolean): Unit = diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/compatibility.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/compatibility.kt index 1c82144d755..1d75e0d3055 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/compatibility.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/compatibility.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME // !JVM_DEFAULT_MODE: compatibility // TARGET_BACKEND: JVM @@ -10,7 +10,8 @@ interface Path { fun Int.extension(maxDepth: Int = 42) } -inline class RealPath(val x: Int) : Path { +@JvmInline +value class RealPath(val x: Int) : Path { override fun dispatch(maxDepth: Int) = Unit fun childrenDispatch(recursively: Boolean): Unit = diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/default.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/default.kt index a30f4a2de7d..53c2040e5d4 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/default.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/default.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME // TARGET_BACKEND: JVM // IGNORE_BACKEND: JVM @@ -9,7 +9,8 @@ interface Path { fun Int.extension(maxDepth: Int = 42) } -inline class RealPath(val x: Int) : Path { +@JvmInline +value class RealPath(val x: Int) : Path { override fun dispatch(maxDepth: Int) = Unit fun childrenDispatch(recursively: Boolean): Unit = diff --git a/compiler/testData/codegen/box/inlineClasses/defaultWithInlineClassArgument.kt b/compiler/testData/codegen/box/inlineClasses/defaultWithInlineClassArgument.kt index 525a4e68e82..32019255cea 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultWithInlineClassArgument.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultWithInlineClassArgument.kt @@ -1,8 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME // FILE: a.kt fun box() = A(0).f() // FILE: b.kt -inline class A(val i: Int) +@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 676a7f7042f..2601c7a70b7 100644 --- a/compiler/testData/codegen/box/inlineClasses/elvisWithInlineClassAndNullConstant.kt +++ b/compiler/testData/codegen/box/inlineClasses/elvisWithInlineClassAndNullConstant.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class UInt(private val data: Int) { +@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 1907b764c34..85401daa5e6 100644 --- a/compiler/testData/codegen/box/inlineClasses/emptyConstructorForInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/emptyConstructorForInlineClass.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Foo(val s: String) { +@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 5de9ddef6c6..435794342af 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksInlineClassNonNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksInlineClassNonNull.kt @@ -1,7 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Inner(val w: String) -inline class A(val x: Inner) +@JvmInline +value class Inner(val w: String) +@JvmInline +value class A(val x: Inner) fun isNullVacuousLeft(s: A) = s == null fun isNullVacuousRight(s: A) = null == s diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksMixedNullability.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksMixedNullability.kt index a2acdf9dd14..fbf68b2bb86 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksMixedNullability.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksMixedNullability.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val a: String) +@JvmInline +value class A(val a: String) fun isEqualNA(x: A?, y: A) = x == y fun isEqualAN(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 6fe87b662ed..6f51daeb752 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedInlineClassNonNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedInlineClassNonNull.kt @@ -1,7 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Inner(val w: String) -inline class A(val x: Inner) +@JvmInline +value class Inner(val w: String) +@JvmInline +value class A(val x: Inner) fun isNotNullVacuousLeft(s: A) = s != null fun isNotNullVacuousRight(s: A) = null != s diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNonNull.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNonNull.kt index a95008b5d45..a18131246a3 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNonNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNonNull.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val x: String) +@JvmInline +value class A(val x: String) fun isNotNullVacuousLeft(s: A) = s != null fun isNotNullVacuousRight(s: A) = null != s diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNullable.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNullable.kt index 6198fcc1fed..f39e3717fd3 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNullable.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedNullable.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val x: Any?) +@JvmInline +value class A(val x: Any?) fun isNotNullVacuousLeft(s: A) = s != null fun isNotNullVacuousRight(s: A) = null != s diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedPrimitive.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedPrimitive.kt index ec617c1c778..da60312db0d 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedPrimitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksNegatedPrimitive.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val x: Int) +@JvmInline +value class A(val x: Int) fun isNotNullVacuousLeft(s: A) = s != null fun isNotNullVacuousRight(s: A) = null != s diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksNonNull.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksNonNull.kt index 8eb2092fe7f..ca95760dd4b 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksNonNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksNonNull.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val x: String) +@JvmInline +value class A(val x: String) fun isNullVacuousLeft(s: A) = s == null fun isNullVacuousRight(s: A) = null == s diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksNullable.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksNullable.kt index a2c7ac4faaf..e891d885afb 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksNullable.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksNullable.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val x: Any?) +@JvmInline +value class A(val x: Any?) fun isNullVacuousLeft(s: A) = s == null fun isNullVacuousRight(s: A) = null == s diff --git a/compiler/testData/codegen/box/inlineClasses/equalityChecksPrimitive.kt b/compiler/testData/codegen/box/inlineClasses/equalityChecksPrimitive.kt index 8031254ad1e..5ed0268c2e0 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityChecksPrimitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityChecksPrimitive.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val x: Int) +@JvmInline +value class A(val x: Int) fun isNullVacuousLeft(s: A) = s == null fun isNullVacuousRight(s: A) = null == s diff --git a/compiler/testData/codegen/box/inlineClasses/equalityForBoxesOfNullableValuesOfInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/equalityForBoxesOfNullableValuesOfInlineClass.kt index 8757fa8be9b..8f400601af4 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalityForBoxesOfNullableValuesOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalityForBoxesOfNullableValuesOfInlineClass.kt @@ -1,11 +1,14 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class X(val x: String) -inline class Y(val y: Number) +@JvmInline +value class X(val x: String) +@JvmInline +value class Y(val y: Number) -inline class NX(val x: String?) -inline class NY(val y: Number?) +@JvmInline +value class NX(val x: String?) +@JvmInline +value class NY(val y: Number?) fun testNotNull(x: X?, y: Y?) { val xs = listOf(x) diff --git a/compiler/testData/codegen/box/inlineClasses/equalsCallsLeftArgument.kt b/compiler/testData/codegen/box/inlineClasses/equalsCallsLeftArgument.kt index fdac846434f..871570828c3 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalsCallsLeftArgument.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalsCallsLeftArgument.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val x: String) +@JvmInline +value class A(val x: String) class B { override fun equals(other: Any?) = true diff --git a/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderInlineClass.kt index 206e12625ac..4642c3661a2 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderInlineClass.kt @@ -1,8 +1,10 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Inner(val x: Int) -inline class A(val x: Inner) +@JvmInline +value class Inner(val x: Int) +@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 889df868990..b74855054cd 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderNonNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderNonNull.kt @@ -1,7 +1,8 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val x: String = "") +@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 70f8702f048..0c4abf1efd7 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderNullable.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderNullable.kt @@ -1,7 +1,8 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val x: Any? = null) +@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 99518c95ccd..76deb0a3d00 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderPrimitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalsEvaluationOrderPrimitive.kt @@ -1,7 +1,8 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val x: Int = 0) +@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 b096edde21a..46fa2bea3ac 100644 --- a/compiler/testData/codegen/box/inlineClasses/equalsOperatorWithGenericCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/equalsOperatorWithGenericCall.kt @@ -1,6 +1,11 @@ -inline class IcAny(val x: Any?) -inline class IcInt(val x: Int) -inline class IcLong(val x: Long) +// WITH_RUNTIME + +@JvmInline +value class IcAny(val x: Any?) +@JvmInline +value class IcInt(val x: Int) +@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 8c4812c27b2..23b9de6d596 100644 --- a/compiler/testData/codegen/box/inlineClasses/extLambdaInInlineClassFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/extLambdaInInlineClassFun.kt @@ -1,8 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun T.runExt(fn: T.() -> String) = fn() -inline class R(private val r: Int) { +@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 3df5ff169c4..c7b18f71808 100644 --- a/compiler/testData/codegen/box/inlineClasses/extLambdaInInlineClassFun2.kt +++ b/compiler/testData/codegen/box/inlineClasses/extLambdaInInlineClassFun2.kt @@ -1,8 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun T.runExt(fn: T.() -> String) = fn() -inline class R(private val r: String) { +@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 815e2eabf91..54e6044c78b 100644 --- a/compiler/testData/codegen/box/inlineClasses/fieldNameClash.kt +++ b/compiler/testData/codegen/box/inlineClasses/fieldNameClash.kt @@ -1,4 +1,7 @@ -inline class Z(val s: String) { +// WITH_RUNTIME + +@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 1cb36cd4b91..7ccc70895c0 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 -inline class Result(val isSuccess: Boolean) +@JvmInline +value class Result(val isSuccess: Boolean) fun interface ResultHandler { fun onResult(result: Result) diff --git a/compiler/testData/codegen/box/inlineClasses/funInterface/mangledSamWrappers.kt b/compiler/testData/codegen/box/inlineClasses/funInterface/mangledSamWrappers.kt index 0db1af93a74..45e0b0d5e59 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 -// !LANGUAGE: +InlineClasses -inline class A(val value: String) +// WITH_RUNTIME +@JvmInline +value class A(val value: String) fun interface B { fun f(x: A): A diff --git a/compiler/testData/codegen/box/inlineClasses/funInterface/returnIC.kt b/compiler/testData/codegen/box/inlineClasses/funInterface/returnIC.kt index cf6e4180138..e5898a5a8ab 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 -inline class Result(val isSuccess: Boolean) +@JvmInline +value class Result(val isSuccess: Boolean) fun interface ResultHandler { fun onResult(): Result diff --git a/compiler/testData/codegen/box/inlineClasses/functionExpression.kt b/compiler/testData/codegen/box/inlineClasses/functionExpression.kt index 7c25bf4f986..0860d7ca920 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionExpression.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionExpression.kt @@ -1,6 +1,9 @@ +// WITH_RUNTIME + inline fun new(init: (Z) -> Unit): Z = Z(42) -inline class Z(val value: Int) +@JvmInline +value class Z(val value: Int) fun box(): String = if (new(fun(z: Z) {}).value == 42) "OK" else "Fail" diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/anonymousObjectInFunctionWithMangledName.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/anonymousObjectInFunctionWithMangledName.kt index d3cb8cad2ec..45dbd5dedbd 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/anonymousObjectInFunctionWithMangledName.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/anonymousObjectInFunctionWithMangledName.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S(val string: String) +@JvmInline +value class S(val string: String) fun foo(s: S): String { val anon = object { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/extensionFunctionsDoNotClash.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/extensionFunctionsDoNotClash.kt index cfd8a7e729a..a2e12c61ac8 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/extensionFunctionsDoNotClash.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/extensionFunctionsDoNotClash.kt @@ -1,10 +1,13 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Id(val id: String) +@JvmInline +value class Id(val id: String) -inline class Name(val name: String) +@JvmInline +value class Name(val name: String) -inline class Password(val password: String) +@JvmInline +value class Password(val password: String) fun Id.test() { if (id != "OK") throw AssertionError() diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/functionsWithDifferentNullabilityDoNotClash.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/functionsWithDifferentNullabilityDoNotClash.kt index eb5bdcb5105..9ceab7720a3 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/functionsWithDifferentNullabilityDoNotClash.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/functionsWithDifferentNullabilityDoNotClash.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Id(val id: String) +@JvmInline +value class Id(val id: String) fun test(id: Id) { if (id.id != "OK") throw AssertionError() diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericFunctionsDoNotClash.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericFunctionsDoNotClash.kt index 190152a9cdb..dbdfba82239 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericFunctionsDoNotClash.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericFunctionsDoNotClash.kt @@ -1,7 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S1(val s1: String) -inline class S2(val s2: String) +@JvmInline +value class S1(val s1: String) +@JvmInline +value class S2(val s2: String) object X1 object X2 diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericSignatureOfFunctionWithMangledName.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericSignatureOfFunctionWithMangledName.kt index 2880d7ee38d..3256ba1cc75 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericSignatureOfFunctionWithMangledName.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/genericSignatureOfFunctionWithMangledName.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME // TARGET_BACKEND: JVM // WITH_REFLECT @@ -6,8 +6,10 @@ import kotlin.reflect.KFunction import kotlin.reflect.jvm.javaMethod import kotlin.test.* -inline class InlineClass1(val s: String) -inline class InlineClass2(val n: Number) +@JvmInline +value class InlineClass1(val s: String) +@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 9241c2ea373..29a0a5eec5e 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/localClassInFunctionWithMangledName.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/localClassInFunctionWithMangledName.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S(val string: String) +@JvmInline +value class S(val string: String) fun foo(s: S): String { class Local { diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsCanBeOverridden.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsCanBeOverridden.kt index 738300e8b5f..5c04b1d2a58 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsCanBeOverridden.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsCanBeOverridden.kt @@ -1,8 +1,10 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Id(val id: String) +@JvmInline +value class Id(val id: String) -inline class Name(val name: String) +@JvmInline +value class Name(val name: String) interface IA { fun fromInterface(id: Id) diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsDoNotClash.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsDoNotClash.kt index 500146b46a1..b560ee9b7dd 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsDoNotClash.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsDoNotClash.kt @@ -1,10 +1,13 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Id(val id: String) +@JvmInline +value class Id(val id: String) -inline class Name(val name: String) +@JvmInline +value class Name(val name: String) -inline class Password(val password: String) +@JvmInline +value class Password(val password: String) fun test(id: Id) { if (id.id != "OK") throw AssertionError() diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsPresentInStackTrace.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsPresentInStackTrace.kt index d529c2f29d2..624206e9de7 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsPresentInStackTrace.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mangledFunctionsPresentInStackTrace.kt @@ -1,12 +1,12 @@ -// !LANGUAGE: +InlineClasses // IGNORE_BACKEND: JS, JS_IR, WASM // IGNORE_BACKEND: JS_IR_ES6 // FULL_JDK // WITH_RUNTIME // WASM_MUTE_REASON: IGNORED_IN_JS -inline class Id(val id: String) +@JvmInline +value class Id(val id: String) fun throws() { throw RuntimeException() diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mixedSignatureFunctionsDoNotClash.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mixedSignatureFunctionsDoNotClash.kt index efcdc4441e7..755c833a8ab 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mixedSignatureFunctionsDoNotClash.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/mixedSignatureFunctionsDoNotClash.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Id(val id: String) +@JvmInline +value class Id(val id: String) fun test(id: Id, str: String) { if (id.id != "OK" && str != "1") throw AssertionError() diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass.kt index ef11a37f115..1a6582f1a9d 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass.kt @@ -1,10 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME abstract class GenericBase { abstract fun foo(x: T): T } -inline class Str(val str: String) +@JvmInline +value class Str(val str: String) class Derived : GenericBase() { override fun foo(x: Str): Str = x diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass2.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass2.kt index b4a96bc5bd4..ed103617874 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass2.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/overridingMethodInGenericClass2.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME abstract class GenericBase { abstract fun foo(x: T): T @@ -8,7 +8,8 @@ interface IFoo { fun foo(x: String): String } -inline class Str(val str: String) +@JvmInline +value class Str(val str: String) class Derived : GenericBase(), IFoo { override fun foo(x: Str): Str = x diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/propertySetterWithInlineClassTypeArgument.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/propertySetterWithInlineClassTypeArgument.kt index 92fd9a9542f..2e44f89d981 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/propertySetterWithInlineClassTypeArgument.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/propertySetterWithInlineClassTypeArgument.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Str(val string: String) +@JvmInline +value class Str(val string: String) class C { var s = Str("") diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForFunctionWithMangledName.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForFunctionWithMangledName.kt index 20cb9d58063..16d165be240 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForFunctionWithMangledName.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForFunctionWithMangledName.kt @@ -1,8 +1,8 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME import kotlin.test.* -inline class S(val string: String) +@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 c89652587d4..38add275d71 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForLocalClassInFunctionWithMangledName.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForLocalClassInFunctionWithMangledName.kt @@ -1,9 +1,9 @@ -// !LANGUAGE: +InlineClasses // TARGET_BACKEND: JVM // WITH_REFLECT import kotlin.test.* -inline class S(val string: String) +@JvmInline +value class S(val string: String) fun test(s: S) { class Local diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForPropertyOfInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForPropertyOfInlineClassType.kt index 2a43d97f524..441f6eb7408 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForPropertyOfInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/reflectionForPropertyOfInlineClassType.kt @@ -1,8 +1,8 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME import kotlin.test.* -inline class S(val string: String) +@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 84e306b8a1f..0360ca179a2 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorForFunctionWithMangledName.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorForFunctionWithMangledName.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S(val string: String) +@JvmInline +value class S(val string: String) class Outer { private fun foo(s: S) = s.string diff --git a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorsForPropertyOfInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorsForPropertyOfInlineClassType.kt index 341bfafcef5..6f5e2d96089 100644 --- a/compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorsForPropertyOfInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorsForPropertyOfInlineClassType.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S(val string: String) +@JvmInline +value class S(val string: String) class Outer { private var pr = S("") diff --git a/compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt b/compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt index 2077c416eb5..d1f31315fcc 100644 --- a/compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt +++ b/compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt @@ -1,3 +1,5 @@ +// WITH_RUNTIME + // MODULE: lib1 // FILE: lib1.kt @@ -8,7 +10,8 @@ class C(val t: T) { // MODULE: lib2(lib1) // FILE: lib2.kt -inline class IC(val c: C) { +@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 90748406006..fd0b268b7cc 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 -inline class Polynomial(val coefficients: List) { +@JvmInline +value class Polynomial(val coefficients: List) { constructor(vararg coefficients: T) : this(coefficients.toList()) } fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorReferencedFromOtherFile1.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorReferencedFromOtherFile1.kt index 02447a69190..f1d084beedc 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorReferencedFromOtherFile1.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorReferencedFromOtherFile1.kt @@ -1,9 +1,11 @@ +// WITH_RUNTIME // FILE: 1.kt fun box(): String = X(Z("OK")).z.result // FILE: 2.kt -inline class Z(val result: String) +@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 b57ec5a395b..a3356755875 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorReferencedFromOtherFile2.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorReferencedFromOtherFile2.kt @@ -1,9 +1,11 @@ +// WITH_RUNTIME // FILE: 2.kt fun box(): String = X(Z("OK")).z.result // FILE: 1.kt -inline class Z(val result: String) +@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 cb2496dbad0..101554b5874 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorWithDefaultParameters.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorWithDefaultParameters.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S(val string: String) +@JvmInline +value class S(val string: String) class Test(val x: S, val y: S = S("K")) { val test = x.string + y.string diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCall.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCall.kt index 3b50d927159..4bcc83962da 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCall.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S(val string: String) +@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 21fffac8e8e..5f9c645297f 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCallInSecondaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCallInSecondaryConstructor.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S(val string: String) +@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 12010ff4ba1..9a6be42bad5 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingThisConstructorCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingThisConstructorCall.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S(val string: String) +@JvmInline +value class S(val string: String) class Test(val x: S, val y: S) { constructor(x: S) : this(x, S("K")) diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/enumClassConstructor.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/enumClassConstructor.kt index 498a7ef8e29..ef2a35a337a 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/enumClassConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/enumClassConstructor.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S(val string: String) +@JvmInline +value class S(val string: String) enum class Test(val s: S) { OK(S("OK")) diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/innerClassConstructor.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/innerClassConstructor.kt index 171b43dbd47..fb8120a6ff9 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/innerClassConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/innerClassConstructor.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S(val string: String) +@JvmInline +value class S(val string: String) class Outer(val s1: S) { inner class Inner(val s2: S) { diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/kt28855.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/kt28855.kt index 83525082bac..e92a659ed1d 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/kt28855.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/kt28855.kt @@ -1,6 +1,5 @@ // IGNORE_BACKEND: WASM // WASM_MUTE_REASON: UNSIGNED_ARRAYS -// !LANGUAGE: +InlineClasses // WITH_RUNTIME class C(val x: T, vararg ys: UInt) { diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/primaryConstructor.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/primaryConstructor.kt index 880b1408082..6ae206fd994 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/primaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/primaryConstructor.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S(val string: String) +@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 c94047d5493..e8e241127cc 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/privateConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/privateConstructor.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S(val string: String) +@JvmInline +value class S(val string: String) class Outer private constructor(val s: S) { class Nested { diff --git a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/sealedClassConstructor.kt b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/sealedClassConstructor.kt index bbe0e046b17..a11ffb4cea3 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/sealedClassConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/sealedClassConstructor.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S(val string: String) +@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 5fa46b3101e..2a97ea77edc 100644 --- a/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/secondaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/hiddenConstructor/secondaryConstructor.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class S(val string: String) +@JvmInline +value class S(val string: String) class Test(val s: S) { constructor(x: String, s: S) : this(S(x + s.string)) diff --git a/compiler/testData/codegen/box/inlineClasses/initBlock.kt b/compiler/testData/codegen/box/inlineClasses/initBlock.kt index 30fbf49077d..1fca2451715 100644 --- a/compiler/testData/codegen/box/inlineClasses/initBlock.kt +++ b/compiler/testData/codegen/box/inlineClasses/initBlock.kt @@ -1,11 +1,14 @@ +// WITH_RUNTIME -inline class SingleInitBlock(val s: String) { +@JvmInline +value class SingleInitBlock(val s: String) { init { res = s } } -inline class MultipleInitBlocks(val a: Any?) { +@JvmInline +value class MultipleInitBlocks(val a: Any?) { init { res = "O" } @@ -14,14 +17,16 @@ inline class MultipleInitBlocks(val a: Any?) { } } -inline class Lambda(val s: String) { +@JvmInline +value class Lambda(val s: String) { init { val lambda = { res = s } lambda() } } -inline class FunLiteral(val s: String) { +@JvmInline +value class FunLiteral(val s: String) { init { val funLiteral = fun() { res = s @@ -30,7 +35,8 @@ inline class FunLiteral(val s: String) { } } -inline class ObjectLiteral(val s: String) { +@JvmInline +value class ObjectLiteral(val s: String) { init { val objectLiteral = object { fun run() { @@ -41,7 +47,8 @@ inline class ObjectLiteral(val s: String) { } } -inline class LocalFunction(val s: String) { +@JvmInline +value class LocalFunction(val s: String) { init { fun local() { res = s @@ -50,7 +57,8 @@ inline class LocalFunction(val s: String) { } } -inline class LocalClass(val s: String) { +@JvmInline +value class LocalClass(val s: String) { init { class Local { fun run() { @@ -61,7 +69,8 @@ inline class LocalClass(val s: String) { } } -inline class Getter(val s: String) { +@JvmInline +value class Getter(val s: String) { init { res = ok } @@ -70,7 +79,8 @@ inline class Getter(val s: String) { get() = s } -inline class GetterThis(val s: String) { +@JvmInline +value class GetterThis(val s: String) { init { res = this.ok } @@ -79,7 +89,8 @@ inline class GetterThis(val s: String) { get() = s } -inline class Method(val s: String) { +@JvmInline +value class Method(val s: String) { init { res = ok(this) } @@ -87,7 +98,8 @@ inline class Method(val s: String) { fun ok(m: Method): String = m.s } -inline class MethodThis(val s: String) { +@JvmInline +value class MethodThis(val s: String) { init { res = this.ok(this) } @@ -95,7 +107,8 @@ inline class MethodThis(val s: String) { fun ok(m: MethodThis): String = m.s } -inline class InlineFun(val s: String) { +@JvmInline +value class InlineFun(val s: String) { init { res = ok() } @@ -103,7 +116,8 @@ inline class InlineFun(val s: String) { inline fun ok(): String = s } -inline class InlineFunThis(val s: String) { +@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 9486131d082..63f405ba95b 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassAsLastExpressionInInLambda.kt @@ -1,12 +1,14 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Name(private val value: String) { +@JvmInline +value class Name(private val value: String) { fun asValue(): String = value } fun concat(a: Name, b: Name) = a.asValue() + b.asValue() -inline class UInt(private val value: Int) { +@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 284153155d9..0e268a54bcc 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineCollectionOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineCollectionOfInlineClass.kt @@ -1,8 +1,10 @@ // WITH_RUNTIME -inline class Z(val x: Int) +@JvmInline +value class Z(val x: Int) -inline class ZArray(val storage: IntArray) : Collection { +@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 d97fafd4ea0..55ac1cf55f2 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineListOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineListOfInlineClass.kt @@ -1,8 +1,10 @@ // WITH_RUNTIME -inline class Z(val x: Int) +@JvmInline +value class Z(val x: Int) -inline class ZArray(val storage: IntArray) : List { +@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 81fa9a51558..23830e65276 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineMapOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassCollection/inlineMapOfInlineClass.kt @@ -1,8 +1,10 @@ // WITH_RUNTIME -inline class Z(val x: Int) +@JvmInline +value class Z(val x: Int) -inline class ZArrayMap(val storage: IntArray) : Map { +@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 cbad8cf3a2f..da87de900a0 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassEqualityShouldUseTotalOrderForFloatingPointData.kt @@ -1,8 +1,10 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class InlineFloat(val data: Float) +@JvmInline +value class InlineFloat(val data: Float) -inline class InlineDouble(val data: Double) +@JvmInline +value class InlineDouble(val data: Double) fun box(): String { if (InlineFloat(0.0f) == InlineFloat(-0.0f)) throw AssertionError() diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt index 304f184e48e..f4806f4d2d4 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassFieldHandling.kt @@ -1,8 +1,12 @@ +// WITH_RUNTIME + var result = "Fail" -inline class A(val value: String) +@JvmInline +value class A(val value: String) -inline class B(val a: A) { +@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 0d3135e3d23..63c31e23bb0 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassFunctionInvoke.kt @@ -1,11 +1,13 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val int: Int) +@JvmInline +value class Z(val int: Int) -inline class Str(val string: String) +@JvmInline +value class Str(val string: String) -inline class NStr(val string: String?) +@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 73c34865878..c49d5471a0e 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassImplementsCollection.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassImplementsCollection.kt @@ -1,10 +1,11 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME // TARGET_BACKEND: JVM -inline class MyUInt(val x: Int) +@JvmInline +value class MyUInt(val x: Int) -inline class MyUIntArray(private val storage: IntArray) : Collection { +@JvmInline +value class MyUIntArray(private val storage: IntArray) : Collection { public override val size: Int get() = storage.size override operator fun iterator() = TODO() diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt index 39405454fd6..4e4b63d202e 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassInInitBlock.kt @@ -1,6 +1,9 @@ +// WITH_RUNTIME + var result = "Fail" -inline class A(val value: String) { +@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 bc34918261e..b1fbff5e54f 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassInStringTemplate.kt @@ -1,9 +1,9 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME import kotlin.test.* -inline class Z(val value: Int) +@JvmInline +value class Z(val value: Int) fun test1_1(z: Z) = "$z" fun test1_2(z: Z) = "$z$z" diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassPropertyReferenceGetAndSet.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassPropertyReferenceGetAndSet.kt index e75ce35c2bc..66373461428 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassPropertyReferenceGetAndSet.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassPropertyReferenceGetAndSet.kt @@ -1,7 +1,7 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Foo(val z: String) +@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 f9977f9b9e9..2d27e5f16c6 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassValueCapturedInInlineLambda.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassValueCapturedInInlineLambda.kt @@ -1,9 +1,13 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z(val int: Int) -inline class L(val long: Long) -inline class Str(val string: String) -inline class Obj(val obj: Any) +@JvmInline +value class Z(val int: Int) +@JvmInline +value class L(val long: Long) +@JvmInline +value class Str(val string: String) +@JvmInline +value class Obj(val obj: Any) fun box(): String { var xz = Z(0) diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassValueCapturedInNonInlineLambda.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassValueCapturedInNonInlineLambda.kt index b0731e2e5d4..4c85b89a618 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassValueCapturedInNonInlineLambda.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassValueCapturedInNonInlineLambda.kt @@ -1,9 +1,13 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z(val int: Int) -inline class L(val long: Long) -inline class Str(val string: String) -inline class Obj(val obj: Any) +@JvmInline +value class Z(val int: Int) +@JvmInline +value class L(val long: Long) +@JvmInline +value class Str(val string: String) +@JvmInline +value class Obj(val obj: Any) fun box(): String { var xz = Z(0) diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt index 336642d15ca..46867fad72d 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt @@ -1,10 +1,12 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Augmented(val x: Int) { +@JvmInline +value class Augmented(val x: Int) { override fun toString(): String = (x + 1).toString() } -inline class AsAny(val a: Any) { +@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 55485d1d0b1..c9f975f86d6 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassWithCustomEquals.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassWithCustomEquals.kt @@ -1,11 +1,12 @@ // IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JVM // IGNORE_BACKEND: JVM_IR -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME @file:Suppress("RESERVED_MEMBER_INSIDE_INLINE_CLASS") -inline class Z(val data: Int) { +@JvmInline +value class Z(val data: Int) { override fun equals(other: Any?): Boolean = other is Z && data % 256 == other.data % 256 diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassWithDefaultFunctionsFromAny.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassWithDefaultFunctionsFromAny.kt index 3899a4a35f6..c2a68941447 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassWithDefaultFunctionsFromAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassWithDefaultFunctionsFromAny.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z(val data: Int) +@JvmInline +value class Z(val data: Int) fun box(): String { if (Z(0) != Z(0)) throw AssertionError() diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassesAsInlineFunParameters.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassesAsInlineFunParameters.kt index cb7f85ebe79..9fe2c11fa56 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassesAsInlineFunParameters.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassesAsInlineFunParameters.kt @@ -1,9 +1,13 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z(val int: Int) -inline class L(val long: Long) -inline class Str(val string: String) -inline class Obj(val obj: Any) +@JvmInline +value class Z(val int: Int) +@JvmInline +value class L(val long: Long) +@JvmInline +value class Str(val string: String) +@JvmInline +value class Obj(val obj: Any) inline fun s1Z(x: Z, fn: (Int, Z) -> R) = fn(1, x) inline fun s1L(x: L, fn: (Int, L) -> R) = fn(1, x) diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassesCheckCast.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassesCheckCast.kt index 768ca4ca0ee..a92b32f7ea8 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassesCheckCast.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassesCheckCast.kt @@ -1,7 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class AsAny(val x: Any?) -inline class AsInt(val x: Int) +@JvmInline +value class AsAny(val x: Any?) +@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 b96e2b4b0cc..669f9b8607c 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassesInInlineLambdaParameters.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassesInInlineLambdaParameters.kt @@ -1,7 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z(val int: Int) -inline class L(val long: Long) +@JvmInline +value class Z(val int: Int) +@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 653d8589515..331431b728f 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassesRefTypesInInlineLambdaParameters.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassesRefTypesInInlineLambdaParameters.kt @@ -1,7 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Str(val string: String) -inline class Obj(val obj: Any) +@JvmInline +value class Str(val string: String) +@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 d73665dc9c0..4b0c9f9885e 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineExtLambdaInInlineClassFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineExtLambdaInInlineClassFun.kt @@ -1,8 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME inline fun T.runInlineExt(fn: T.() -> String) = fn() -inline class R(private val r: Int) { +@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 c0490f4b077..9a01efb6f18 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineExtLambdaInInlineClassFun2.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineExtLambdaInInlineClassFun2.kt @@ -1,8 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME inline fun T.runInlineExt(fn: T.() -> String) = fn() -inline class R(private val r: String) { +@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 4b4ea1c59df..fad5978390f 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineFunctionInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineFunctionInsideInlineClass.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Foo(val x: Int) { +@JvmInline +value class Foo(val x: Int) { inline fun inc(): Foo = Foo(x + 1) } diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/interfaceImplementationByDelegation.kt b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/interfaceImplementationByDelegation.kt index f80b888b0bf..7cdb3fbce57 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/interfaceImplementationByDelegation.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/interfaceImplementationByDelegation.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME interface IFoo { fun getO(): String @@ -7,7 +7,8 @@ interface IFoo { val ok: String get() = getO() + k } -inline class InlineFooImpl(val s: String): IFoo { +@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 43b42899604..d317a47e03b 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 -inline class Wrapper(val id: Int) +@JvmInline +value class Wrapper(val id: Int) class DMap(private val map: Map) : Map by map diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberExtValDelegationWithInlineClassParameterTypes.kt b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberExtValDelegationWithInlineClassParameterTypes.kt index 6acb15e7b0e..63d6dada93b 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 -inline class S(val x: String) +@JvmInline +value class S(val x: String) interface IFoo { val S.extVal: String diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberExtVarDelegationWithInlineClassParameterTypes.kt b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberExtVarDelegationWithInlineClassParameterTypes.kt index 00cd7c82b37..2676eca3b3a 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 -inline class S(val xs: Array) +@JvmInline +value class S(val xs: Array) interface IFoo { var S.extVar: String diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegatedToInlineClassInt.kt b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegatedToInlineClassInt.kt index 5ce5b93f9c0..7db49237466 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 } -inline class Z(val x: Int) : IFoo { +@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 bfdb2a0bda6..a96c529bbc3 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 } -inline class Z(val x: Long) : IFoo { +@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 3c22e71d34e..d8c3eeca2d7 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 -inline class S(val x: String) +@JvmInline +value class S(val x: String) interface IFoo { fun memberFun(s1: S, s2: String): String @@ -12,7 +13,8 @@ interface IFoo { fun T.genericMemberExtFun(x: X): String } -inline class FooImpl(val xs: Array) : IFoo { +@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 override fun genericMemberFun(x1: S, x2: X): String = xs[0] + x1.x + x2.toString() diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegationWithInlineClassParameterTypes.kt b/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegationWithInlineClassParameterTypes.kt index b188d8ed752..7f1e330b252 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 -inline class S(val x: String) +@JvmInline +value class S(val x: String) interface IFoo { fun memberFun(s1: S, s2: String): String diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride.kt index a47830b0e5a..ad6265df315 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val s: String) +@JvmInline +value class A(val s: String) abstract class B { abstract fun f(x: T, y: U): String diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride2.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride2.kt index 728b49b9830..285be44b7a4 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride2.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride2.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val s: String) +@JvmInline +value class A(val s: String) interface B { fun f(x: T, y: U): String diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride3.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride3.kt index 6fa8b088d3e..64aea31bd08 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride3.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/complexGenericMethodWithInlineClassOverride3.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val s: String) +@JvmInline +value class A(val s: String) interface B { fun f(x: T): T diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceExtensionFunCall.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceExtensionFunCall.kt index e54809f4f70..0e3fa5a5cae 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceExtensionFunCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceExtensionFunCall.kt @@ -1,19 +1,22 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME interface IFoo { fun Long.foo() = bar() fun bar(): String } -inline class Z(val x: Int) : IFoo { +@JvmInline +value class Z(val x: Int) : IFoo { override fun bar(): String = "OK" } -inline class L(val x: Long) : IFoo { +@JvmInline +value class L(val x: Long) : IFoo { override fun bar(): String = "OK" } -inline class S(val x: String) : IFoo { +@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 465f5227353..d4accbee19b 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceMethodCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceMethodCall.kt @@ -1,19 +1,22 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME interface IFoo { fun foo() = bar() fun bar(): String } -inline class Z(val x: Int) : IFoo { +@JvmInline +value class Z(val x: Int) : IFoo { override fun bar(): String = "OK" } -inline class L(val x: Long) : IFoo { +@JvmInline +value class L(val x: Long) : IFoo { override fun bar(): String = "OK" } -inline class S(val x: String) : IFoo { +@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 a2d19a00e7e..de883b84fef 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericDefaultInterfaceExtensionFunCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericDefaultInterfaceExtensionFunCall.kt @@ -1,19 +1,22 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME interface IFoo> { fun T.foo(): String = bar() fun bar(): String } -inline class Z(val x: Int) : IFoo { +@JvmInline +value class Z(val x: Int) : IFoo { override fun bar(): String = "OK" } -inline class L(val x: Long) : IFoo { +@JvmInline +value class L(val x: Long) : IFoo { override fun bar(): String = "OK" } -inline class S(val x: String) : IFoo { +@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 bb57c312aa5..8130735d9c5 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericDefaultInterfaceMethodCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericDefaultInterfaceMethodCall.kt @@ -1,11 +1,12 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME interface IFoo> { fun foo(t: T): String = t.bar() fun bar(): String } -inline class Z(val x: Int) : IFoo { +@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 ad7d1e89f8b..4f03a5b11fb 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericInterfaceMethodCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericInterfaceMethodCall.kt @@ -1,10 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME interface IFoo { fun foo(x: T): String } -inline class Z(val x: Int) : IFoo { +@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 94ae6e684ea..0a3f0ab0f2f 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericMethodWithInlineClassOverride.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericMethodWithInlineClassOverride.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class A(val s: String) +@JvmInline +value class A(val s: String) abstract class B { abstract fun f(x: T): T diff --git a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/interfaceSuperCall.kt b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/interfaceSuperCall.kt index 1b02418da86..b5307cb6514 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/interfaceSuperCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/interfaceSuperCall.kt @@ -1,10 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME interface A { fun f(x: String) = x } -inline class B(val y: String) : A { +@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 2903f7383d0..924a526fab8 100644 --- a/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/overriddenDefaultInterfaceMethodCall.kt +++ b/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/overriddenDefaultInterfaceMethodCall.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME interface IBase { fun foo() = "BAD" @@ -8,11 +8,14 @@ interface IFoo : IBase { override fun foo() = "OK" } -inline class Z(val x: Int) : IFoo +@JvmInline +value class Z(val x: Int) : IFoo -inline class L(val x: Long) : IFoo +@JvmInline +value class L(val x: Long) : IFoo -inline class S(val x: String) : IFoo +@JvmInline +value class S(val x: String) : IFoo fun box(): String { if (Z(42).foo() != "OK") throw AssertionError() diff --git a/compiler/testData/codegen/box/inlineClasses/iterateOverArrayOfInlineClassValues.kt b/compiler/testData/codegen/box/inlineClasses/iterateOverArrayOfInlineClassValues.kt index b997b8651e7..d0b26898994 100644 --- a/compiler/testData/codegen/box/inlineClasses/iterateOverArrayOfInlineClassValues.kt +++ b/compiler/testData/codegen/box/inlineClasses/iterateOverArrayOfInlineClassValues.kt @@ -1,8 +1,9 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Foo(val arg: Int) -inline class AsAny(val arg: Any) +@JvmInline +value class Foo(val arg: Int) +@JvmInline +value class AsAny(val arg: Any) fun box(): String { val arr = arrayOf(Foo(1), Foo(2)) diff --git a/compiler/testData/codegen/box/inlineClasses/iterateOverListOfInlineClassValues.kt b/compiler/testData/codegen/box/inlineClasses/iterateOverListOfInlineClassValues.kt index 28d340f3909..711ce54f41e 100644 --- a/compiler/testData/codegen/box/inlineClasses/iterateOverListOfInlineClassValues.kt +++ b/compiler/testData/codegen/box/inlineClasses/iterateOverListOfInlineClassValues.kt @@ -1,7 +1,7 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Foo(val arg: String) +@JvmInline +value class Foo(val arg: String) fun box(): String { val ls = listOf(Foo("abc"), Foo("def")) diff --git a/compiler/testData/codegen/box/inlineClasses/javaClassIntrinsicOnInlineClasses.kt b/compiler/testData/codegen/box/inlineClasses/javaClassIntrinsicOnInlineClasses.kt index 58684a82a0a..c0973b4c09f 100644 --- a/compiler/testData/codegen/box/inlineClasses/javaClassIntrinsicOnInlineClasses.kt +++ b/compiler/testData/codegen/box/inlineClasses/javaClassIntrinsicOnInlineClasses.kt @@ -3,10 +3,14 @@ package root -inline class IcInt(val x: Int) -inline class IcLong(val l: Long) -inline class IcAny(val a: Any?) -inline class IcOverIc(val o: IcLong) +@JvmInline +value class IcInt(val x: Int) +@JvmInline +value class IcLong(val l: Long) +@JvmInline +value class IcAny(val a: Any?) +@JvmInline +value class IcOverIc(val o: IcLong) fun check(c: Class<*>, s: String) { if (c.toString() != s) error("Fail, expected: $s, actual: $c") diff --git a/compiler/testData/codegen/box/inlineClasses/javaPrimitiveTypeIC.kt b/compiler/testData/codegen/box/inlineClasses/javaPrimitiveTypeIC.kt index 248e6b2de52..9a3d4164525 100644 --- a/compiler/testData/codegen/box/inlineClasses/javaPrimitiveTypeIC.kt +++ b/compiler/testData/codegen/box/inlineClasses/javaPrimitiveTypeIC.kt @@ -2,10 +2,14 @@ // WITH_RUNTIME import kotlin.test.* -inline class I(val x: Int) -inline class JLI(val x: java.lang.Integer) -inline class U(val x: Unit?) -inline class N(val x: Nothing?) +@JvmInline +value class I(val x: Int) +@JvmInline +value class JLI(val x: java.lang.Integer) +@JvmInline +value class U(val x: Unit?) +@JvmInline +value class N(val x: Nothing?) val icUnit = U(Unit) val icNull = N(null) diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt index 5ac8bf8e81f..4ff89ac8114 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt @@ -1,7 +1,9 @@ // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 +// WITH_RUNTIME // FILE: javaDefaultMethod.kt -inline class K(val k: String) : J { +@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 841caea6370..bc9cd70d608 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethodOverriddenByKotlin.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethodOverriddenByKotlin.kt @@ -1,11 +1,13 @@ // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 +// WITH_RUNTIME // FILE: javaDefaultMethod.kt interface K2 : J { override fun get2() = "Kotlin" } -inline class K(val k: String) : K2 { +@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 982fd903f4b..807ccabc090 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAll.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAll.kt @@ -11,11 +11,13 @@ interface IFooBar { interface IFooBar2 : IFooBar -inline class Test1(val k: String): IFooBar { +@JvmInline +value class Test1(val k: String): IFooBar { override fun bar(): String = k } -inline class Test2(val k: String): IFooBar2 { +@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 60c3c31c0b9..98cfce3457c 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllPrimaryProperty.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllPrimaryProperty.kt @@ -11,9 +11,11 @@ interface IFooBar { interface IFooBar2 : IFooBar -inline class Test1(override val bar: String): IFooBar +@JvmInline +value class Test1(override val bar: String): IFooBar -inline class Test2(override val bar: String): IFooBar2 +@JvmInline +value class Test2(override val bar: String): IFooBar2 fun box(): String { val k = Test1("K") diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllProperty.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllProperty.kt index 3e6073335c7..b53cde82eda 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllProperty.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllProperty.kt @@ -11,12 +11,14 @@ interface IFooBar { interface IFooBar2 : IFooBar -inline class Test1(val k: String): IFooBar { +@JvmInline +value class Test1(val k: String): IFooBar { override val bar: String get() = k } -inline class Test2(val k: String): IFooBar2 { +@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 cb5146a2de9..2d8fcaa1094 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnable.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnable.kt @@ -11,11 +11,13 @@ interface IFooBar { interface IFooBar2 : IFooBar -inline class Test1(val k: String): IFooBar { +@JvmInline +value class Test1(val k: String): IFooBar { override fun bar(): String = k } -inline class Test2(val k: String): IFooBar2 { +@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 61f78c66454..0ef8feb7216 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnablePrimaryProperty.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnablePrimaryProperty.kt @@ -11,9 +11,11 @@ interface IFooBar { interface IFooBar2 : IFooBar -inline class Test1(override val bar: String): IFooBar +@JvmInline +value class Test1(override val bar: String): IFooBar -inline class Test2(override val bar: String): IFooBar2 +@JvmInline +value class Test2(override val bar: String): IFooBar2 fun box(): String { val k = Test1("K") diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt index 7259e2d0952..b43d348fdaa 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt @@ -11,12 +11,14 @@ interface IFooBar { interface IFooBar2 : IFooBar -inline class Test1(val k: String): IFooBar { +@JvmInline +value class Test1(val k: String): IFooBar { override val bar: String get() = k } -inline class Test2(val k: String): IFooBar2 { +@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 968baae4f5a..a9877f88eb9 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" } -inline class InlineClass(val s: String) : IOk +@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 eb88d38a2f7..02de8d20073 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" } -inline class InlineClass(val s: String) : IOk +@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 9dbb31e7c3a..5f3edb4d72d 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" } -inline class InlineClass(val s: String) : IOk +@JvmInline +value class InlineClass(val s: String) : IOk fun test(x: Any): String { return if (x is InlineClass) x.ok() else "FAIL" diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSuspend.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSuspend.kt index 31ded160631..3527a6dba3a 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" } -inline class InlineClass(val s: String) : IOk +@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 904040f057b..7fc648fb068 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvmFieldInInlineClassCompanion.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvmFieldInInlineClassCompanion.kt @@ -1,9 +1,9 @@ -// !LANGUAGE: +InlineClasses // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: test.kt -inline class R(private val r: Int) { +@JvmInline +value class R(private val r: Int) { companion object { @JvmField diff --git a/compiler/testData/codegen/box/inlineClasses/jvmOverloadsOnTopLevelFunctionReturningInlineClassValue.kt b/compiler/testData/codegen/box/inlineClasses/jvmOverloadsOnTopLevelFunctionReturningInlineClassValue.kt index 051d5314c57..3b119bad77f 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 -inline class Str(val s: String) +@JvmInline +value class Str(val s: String) @JvmOverloads fun test(so: String = "O", sk: String = "K") = Str(so + sk) diff --git a/compiler/testData/codegen/box/inlineClasses/jvmStaticFunInInlineClassCompanion.kt b/compiler/testData/codegen/box/inlineClasses/jvmStaticFunInInlineClassCompanion.kt index 9421ccb6a10..98392fcc7bf 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvmStaticFunInInlineClassCompanion.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvmStaticFunInInlineClassCompanion.kt @@ -1,9 +1,9 @@ -// !LANGUAGE: +InlineClasses // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: test.kt -inline class R(private val r: Int) { +@JvmInline +value class R(private val r: Int) { companion object { @JvmStatic diff --git a/compiler/testData/codegen/box/inlineClasses/jvmStaticPropertyAccessorInInlineClassCompanion.kt b/compiler/testData/codegen/box/inlineClasses/jvmStaticPropertyAccessorInInlineClassCompanion.kt index 23a0891dfdc..4d779fdd4e0 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvmStaticPropertyAccessorInInlineClassCompanion.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvmStaticPropertyAccessorInInlineClassCompanion.kt @@ -1,9 +1,9 @@ -// !LANGUAGE: +InlineClasses // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: test.kt -inline class R(private val r: Int) { +@JvmInline +value class R(private val r: Int) { companion object { val ok diff --git a/compiler/testData/codegen/box/inlineClasses/jvmStaticVarInInlineClassCompanion.kt b/compiler/testData/codegen/box/inlineClasses/jvmStaticVarInInlineClassCompanion.kt index 07966551096..a6cdeabe6ce 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvmStaticVarInInlineClassCompanion.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvmStaticVarInInlineClassCompanion.kt @@ -1,9 +1,9 @@ -// !LANGUAGE: +InlineClasses // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: test.kt -inline class R(private val r: Int) { +@JvmInline +value class R(private val r: Int) { companion object { private var ok_ = "" diff --git a/compiler/testData/codegen/box/inlineClasses/kt25246.kt b/compiler/testData/codegen/box/inlineClasses/kt25246.kt index 147e08d1258..e9225657cd3 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt25246.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt25246.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Rgba(val value: Int) { +@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 inline val b: Int get() = (value shr 16) and 0xFF @@ -18,7 +19,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) -inline class RgbaArray(val array: IntArray) { +@JvmInline +value class RgbaArray(val array: IntArray) { constructor(size: Int) : this(IntArray(size)) operator fun get(index: Int): Rgba = Rgba(array[index]) operator fun set(index: Int, color: Rgba) { diff --git a/compiler/testData/codegen/box/inlineClasses/kt25750.kt b/compiler/testData/codegen/box/inlineClasses/kt25750.kt index bdb0cd98ffe..ceaa62c8690 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt25750.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt25750.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME import kotlin.reflect.KMutableProperty0 @@ -7,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() -inline class Foo(val i: Int) +@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 29197919704..9c27fb07c83 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt25771.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt25771.kt @@ -1,7 +1,8 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Result(val value: Any?) { +@JvmInline +value class Result(val value: Any?) { val isFailure: Boolean get() = value is Failure public companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/kt26103.kt b/compiler/testData/codegen/box/inlineClasses/kt26103.kt index 34321c0a014..35f6dacf302 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt26103.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt26103.kt @@ -1,11 +1,14 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Bar(val y: Int) +@JvmInline +value class Bar(val y: Int) -inline class Foo(val x: Int) -inline class Foo2(val x: Foo) -inline class Foo3(val x: Bar) +@JvmInline +value class Foo(val x: Int) +@JvmInline +value class Foo2(val x: Foo) +@JvmInline +value class Foo3(val x: Bar) fun testValueParameter(z: Foo) = z.x fun testValueParameter2(z: Foo2) = z.x.x diff --git a/compiler/testData/codegen/box/inlineClasses/kt26103_contravariantUnderlyingType.kt b/compiler/testData/codegen/box/inlineClasses/kt26103_contravariantUnderlyingType.kt index 11ddde91254..8376df37ce2 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt26103_contravariantUnderlyingType.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt26103_contravariantUnderlyingType.kt @@ -1,20 +1,27 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class GCmp(val xc: Comparable) -inline class GSCmp(val sc: Comparable) -inline class SCmp(val sc: Comparable) -inline class ICmp(val intc: Comparable) -inline class GICmp(val intc: Comparable) +@JvmInline +value class GCmp(val xc: Comparable) +@JvmInline +value class GSCmp(val sc: Comparable) +@JvmInline +value class SCmp(val sc: Comparable) +@JvmInline +value class ICmp(val intc: Comparable) +@JvmInline +value class GICmp(val intc: Comparable) -inline class II(val i: Int) : Comparable { +@JvmInline +value class II(val i: Int) : Comparable { override fun compareTo(other: II): Int { return i.compareTo(other.i) } } -inline class IICmp(val iic: Comparable) -inline class GIICmp(val iic: Comparable) +@JvmInline +value class IICmp(val iic: Comparable) +@JvmInline +value class GIICmp(val iic: Comparable) fun testGCmp(x: GCmp) { if (x.xc.compareTo("OK") != 0) throw AssertionError() diff --git a/compiler/testData/codegen/box/inlineClasses/kt26103_covariantUnderlyingType.kt b/compiler/testData/codegen/box/inlineClasses/kt26103_covariantUnderlyingType.kt index 21158027b11..cd956d28a1e 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt26103_covariantUnderlyingType.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt26103_covariantUnderlyingType.kt @@ -1,15 +1,22 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class GList(val xs: List) -inline class GSList(val ss: List) -inline class SList(val ss: List) -inline class IList(val ints: List) -inline class GIList(val ints: List) +@JvmInline +value class GList(val xs: List) +@JvmInline +value class GSList(val ss: List) +@JvmInline +value class SList(val ss: List) +@JvmInline +value class IList(val ints: List) +@JvmInline +value class GIList(val ints: List) -inline class II(val i: Int) -inline class IIList(val iis: List) -inline class GIIList(val iis: List) +@JvmInline +value class II(val i: Int) +@JvmInline +value class IIList(val iis: List) +@JvmInline +value class GIIList(val iis: List) fun testGList(gl: GList) { if (gl.xs[0] != "OK") throw AssertionError() diff --git a/compiler/testData/codegen/box/inlineClasses/kt26103_original.kt b/compiler/testData/codegen/box/inlineClasses/kt26103_original.kt index 0be2c6752ba..18f721cf811 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt26103_original.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt26103_original.kt @@ -1,7 +1,7 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Foo(val x: Int) +@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 33bfa0a4be6..642eadac244 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096.kt @@ -1,7 +1,7 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Ucn(private val i: UInt) +@JvmInline +value class Ucn(private val i: UInt) class PPInput(private val s: ByteArray) { fun peek(n: UInt = 0u): Ucn? = diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096_enum.kt b/compiler/testData/codegen/box/inlineClasses/kt27096_enum.kt index 22f381b54e0..2abb8689000 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096_enum.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096_enum.kt @@ -1,10 +1,13 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME enum class En { N, A, B, C } -inline class Z1(val x: En) -inline class Z2(val z: Z1) -inline class ZN(val z: Z1?) +@JvmInline +value class Z1(val x: En) +@JvmInline +value class Z2(val z: Z1) +@JvmInline +value class ZN(val z: Z1?) fun wrap1(x: En): Z1? = if (x.ordinal == 0) null else Z1(x) fun wrap2(x: En): Z2? = if (x.ordinal == 0) null else Z2(Z1(x)) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096_functional.kt b/compiler/testData/codegen/box/inlineClasses/kt27096_functional.kt index f6c410d8e49..a9ea24f0bca 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096_functional.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096_functional.kt @@ -1,8 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z1(val x: () -> String) -inline class Z2(val z: Z1) -inline class ZN(val z: Z1?) +@JvmInline +value class Z1(val x: () -> String) +@JvmInline +value class Z2(val z: Z1) +@JvmInline +value class ZN(val z: Z1?) fun wrap1(x: String): Z1? = if (x.length == 0) null else Z1({ x }) fun wrap2(x: String): Z2? = if (x.length == 0) null else Z2(Z1({ x })) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096_innerClass.kt b/compiler/testData/codegen/box/inlineClasses/kt27096_innerClass.kt index 0e34c322001..c8791159d38 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096_innerClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096_innerClass.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME class Outer(val x: X) { inner class Inner(val y: Y) { @@ -13,9 +13,12 @@ class Outer(val x: X) { } } -inline class Z1(val x: Outer.Inner) -inline class Z2(val z: Z1) -inline class ZN(val z: Z1?) +@JvmInline +value class Z1(val x: Outer.Inner) +@JvmInline +value class Z2(val z: Z1) +@JvmInline +value class ZN(val z: Z1?) fun wrap1(xy : Outer.Inner): Z1? = if (xy.hasNull) null else Z1(xy) fun wrap2(xy : Outer.Inner): Z2? = if (xy.hasNull) null else Z2(Z1(xy)) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096_nullablePrimitive.kt b/compiler/testData/codegen/box/inlineClasses/kt27096_nullablePrimitive.kt index 45fad644c6d..d3cfe8db8eb 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096_nullablePrimitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096_nullablePrimitive.kt @@ -1,8 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z1(val x: Int?) -inline class Z2(val z: Z1) -inline class ZN(val z: Z1?) +@JvmInline +value class Z1(val x: Int?) +@JvmInline +value class Z2(val z: Z1) +@JvmInline +value class ZN(val z: Z1?) fun wrap1(n: Int): Z1? = if (n < 0) null else Z1(n) fun wrap2(n: Int): Z2? = if (n < 0) null else Z2(Z1(n)) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096_nullableReference.kt b/compiler/testData/codegen/box/inlineClasses/kt27096_nullableReference.kt index 1fbeae87229..999d7019fe8 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096_nullableReference.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096_nullableReference.kt @@ -1,8 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z1(val x: String?) -inline class Z2(val z: Z1) -inline class ZN(val z: Z1?) +@JvmInline +value class Z1(val x: String?) +@JvmInline +value class Z2(val z: Z1) +@JvmInline +value class ZN(val z: Z1?) fun wrap1(x: String): Z1? = if (x.length == 0) null else Z1(x) fun wrap2(x: String): Z2? = if (x.length == 0) null else Z2(Z1(x)) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096_primitive.kt b/compiler/testData/codegen/box/inlineClasses/kt27096_primitive.kt index fa29779adf9..d8221bc76d6 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096_primitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096_primitive.kt @@ -1,9 +1,13 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z1(val x: Int) -inline class Z2(val z: Z1) -inline class ZN(val z: Z1?) -inline class ZN2(val z: ZN) +@JvmInline +value class Z1(val x: Int) +@JvmInline +value class Z2(val z: Z1) +@JvmInline +value class ZN(val z: Z1?) +@JvmInline +value class ZN2(val z: ZN) fun wrap1(n: Int): Z1? = if (n < 0) null else Z1(n) fun wrap2(n: Int): Z2? = if (n < 0) null else Z2(Z1(n)) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27096_reference.kt b/compiler/testData/codegen/box/inlineClasses/kt27096_reference.kt index 9679a5e0e1e..1991ebf84a6 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27096_reference.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27096_reference.kt @@ -1,9 +1,13 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z1(val x: String) -inline class Z2(val z: Z1) -inline class ZN(val z: Z1?) -inline class ZN2(val z: ZN) +@JvmInline +value class Z1(val x: String) +@JvmInline +value class Z2(val z: Z1) +@JvmInline +value class ZN(val z: Z1?) +@JvmInline +value class ZN2(val z: ZN) fun wrap1(x: String): Z1? = if (x.length == 0) null else Z1(x) fun wrap2(x: String): Z2? = if (x.length == 0) null else Z2(Z1(x)) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27113.kt b/compiler/testData/codegen/box/inlineClasses/kt27113.kt index 7066618ed8f..7e65e8adb9c 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27113.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27113.kt @@ -1,6 +1,5 @@ // IGNORE_BACKEND: WASM // WASM_MUTE_REASON: IGNORED_IN_JS -// !LANGUAGE: +InlineClasses // IGNORE_BACKEND: JS, JS_IR, NATIVE // IGNORE_BACKEND: JS_IR_ES6 // WITH_RUNTIME @@ -9,7 +8,8 @@ class CharacterLiteral(private val prefix: NamelessString, private val s: Namele override fun toString(): String = "$prefix'$s'" } -inline class NamelessString(val b: ByteArray) { +@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 f8313d2af33..8a03b6c870f 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27113a.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27113a.kt @@ -1,9 +1,10 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class A(val a: Any) +@JvmInline +value class A(val a: Any) -inline class NA(val b: Any?) +@JvmInline +value class NA(val b: Any?) fun box(): String { val ns1 = NA(A("abc")) diff --git a/compiler/testData/codegen/box/inlineClasses/kt27132.kt b/compiler/testData/codegen/box/inlineClasses/kt27132.kt index 0c1d5cc4a5c..e980ca0f19c 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27132.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27132.kt @@ -1,7 +1,7 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Ucn(private val i: UInt) +@JvmInline +value class Ucn(private val i: UInt) interface Input { fun foo(n: Int = 0): T diff --git a/compiler/testData/codegen/box/inlineClasses/kt27140.kt b/compiler/testData/codegen/box/inlineClasses/kt27140.kt index ac4581f86ee..04405b7425c 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27140.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27140.kt @@ -1,7 +1,7 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(private val i: Int) { +@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 dbc9fbb6785..a1d1da76bb4 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27705.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27705.kt @@ -1,7 +1,7 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) { +@JvmInline +value class Z(val x: Int) { @Suppress("INNER_CLASS_INSIDE_INLINE_CLASS") inner class Inner(val y: Int) { val xx = x diff --git a/compiler/testData/codegen/box/inlineClasses/kt27706.kt b/compiler/testData/codegen/box/inlineClasses/kt27706.kt index c5179393421..7c17dbfb640 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt27706.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt27706.kt @@ -1,7 +1,7 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) { +@JvmInline +value class Z(val x: Int) { @Suppress("INNER_CLASS_INSIDE_INLINE_CLASS") inner class Inner(val z: Z) { val xx = x diff --git a/compiler/testData/codegen/box/inlineClasses/kt28405.kt b/compiler/testData/codegen/box/inlineClasses/kt28405.kt index 74f10bda810..dc28322409b 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt28405.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt28405.kt @@ -1,17 +1,19 @@ // IGNORE_BACKEND: WASM // WASM_MUTE_REASON: STDLIB_TEXT -// !LANGUAGE: +InlineClasses // WITH_RUNTIME import kotlin.test.* -inline class TestUIntArrayW(val x: UIntArray) +@JvmInline +value class TestUIntArrayW(val x: UIntArray) -inline class InlineCharArray(val x: CharArray) { +@JvmInline +value class InlineCharArray(val x: CharArray) { override fun toString(): String = x.contentToString() } -inline class TestInlineCharArrayW(val x: InlineCharArray) +@JvmInline +value class TestInlineCharArrayW(val x: InlineCharArray) fun box(): String { val t1 = TestUIntArrayW(UIntArray(1)).toString() diff --git a/compiler/testData/codegen/box/inlineClasses/kt28585.kt b/compiler/testData/codegen/box/inlineClasses/kt28585.kt index 11625014de8..b6f5faad1f1 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt28585.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt28585.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME fun eval(fn: () -> T) = fn() diff --git a/compiler/testData/codegen/box/inlineClasses/kt33119.kt b/compiler/testData/codegen/box/inlineClasses/kt33119.kt index faf9609f0e5..28e203539ec 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt33119.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt33119.kt @@ -1,5 +1,7 @@ +// WITH_RUNTIME -inline class WrappingInt(val value: Int) { +@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 51d881322bb..7c774a62a3c 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt37998.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt37998.kt @@ -1,4 +1,7 @@ -inline class Z(val x: Int) +// WITH_RUNTIME + +@JvmInline +value class Z(val x: Int) class A { fun foo() = Z(42) diff --git a/compiler/testData/codegen/box/inlineClasses/kt38680.kt b/compiler/testData/codegen/box/inlineClasses/kt38680.kt index 025234af0b4..432dcb7c7ca 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt38680.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt38680.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class IC(val s: String) +@JvmInline +value class IC(val s: String) interface IFoo { fun foo(x: T, s: String = "K"): String diff --git a/compiler/testData/codegen/box/inlineClasses/kt38680a.kt b/compiler/testData/codegen/box/inlineClasses/kt38680a.kt index de77da0b18d..66ba145e370 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt38680a.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt38680a.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class IC(val s: String) +@JvmInline +value class IC(val s: String) interface IFoo { fun foo(x: T, s: String = "K"): String diff --git a/compiler/testData/codegen/box/inlineClasses/kt38680b.kt b/compiler/testData/codegen/box/inlineClasses/kt38680b.kt index 3294ace370e..f3eceb56b90 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt38680b.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt38680b.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class IC(val s: String) +@JvmInline +value class IC(val s: String) interface IFoo { fun foo(x: T, s: String = "K"): String diff --git a/compiler/testData/codegen/box/inlineClasses/kt44701_jvmOverloads.kt b/compiler/testData/codegen/box/inlineClasses/kt44701_jvmOverloads.kt index 1017657b423..556275aedc0 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt44701_jvmOverloads.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt44701_jvmOverloads.kt @@ -2,6 +2,7 @@ // IGNORE_BACKEND: JVM // WITH_RUNTIME -inline class Location @JvmOverloads constructor(val value: String? = "OK") +@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 ff80e81fac4..14dc1a2d81b 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 -inline class StringArray(val values: Array) +@JvmInline +value class StringArray(val values: Array) fun foo(a1: StringArray, a2: StringArray): String { var result = "" diff --git a/compiler/testData/codegen/box/inlineClasses/kt45084.kt b/compiler/testData/codegen/box/inlineClasses/kt45084.kt index 636a9456d87..b0085834b1e 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt45084.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt45084.kt @@ -1,5 +1,7 @@ +// WITH_RUNTIME -inline class Z(val value: Long) +@JvmInline +value class Z(val value: Long) fun f(g: ( z: Z, diff --git a/compiler/testData/codegen/box/inlineClasses/kt46554.kt b/compiler/testData/codegen/box/inlineClasses/kt46554.kt index 6467c4c9f05..6f1c48e0568 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt46554.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt46554.kt @@ -1,6 +1,9 @@ +// WITH_RUNTIME + var result = "Fail" -inline class A(val value: String) { +@JvmInline +value class A(val value: String) { constructor() : this("OK") init { diff --git a/compiler/testData/codegen/box/inlineClasses/kt47609.kt b/compiler/testData/codegen/box/inlineClasses/kt47609.kt index fc0fc4af475..e1bd07115fc 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt47609.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt47609.kt @@ -1,8 +1,11 @@ // WITH_REFLECT // TARGET_BACKEND: JVM +// WITH_RUNTIME + annotation class Ann(val value: String) -inline class C(val x: String) +@JvmInline +value class C(val x: String) @Ann("OK") val C.value: String diff --git a/compiler/testData/codegen/box/inlineClasses/kt47762.kt b/compiler/testData/codegen/box/inlineClasses/kt47762.kt index 714b206fd4c..7693c4aad9d 100644 --- a/compiler/testData/codegen/box/inlineClasses/kt47762.kt +++ b/compiler/testData/codegen/box/inlineClasses/kt47762.kt @@ -1,4 +1,7 @@ -inline class A(val a: Int = 1) { +// WITH_RUNTIME + +@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 437ed048e09..06613d46ff2 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 -inline class C(val x: String) +@JvmInline +value class C(val x: String) // FILE: 2.kt @file:JvmMultifileClass diff --git a/compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt b/compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt index fd636563a6d..51e94c70320 100644 --- a/compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt +++ b/compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt @@ -1,5 +1,6 @@ -// !LANGUAGE: +InlineClasses -inline class X(val s: String) +// WITH_RUNTIME +@JvmInline +value class X(val s: String) fun foo(x: X, block: (X) -> String = { it.s }) = block(x) fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/mangledSuperCalls.kt b/compiler/testData/codegen/box/inlineClasses/mangledSuperCalls.kt index 514ee58c975..38d21f7cd63 100644 --- a/compiler/testData/codegen/box/inlineClasses/mangledSuperCalls.kt +++ b/compiler/testData/codegen/box/inlineClasses/mangledSuperCalls.kt @@ -1,4 +1,7 @@ -inline class I(val i: Int) +// WITH_RUNTIME + +@JvmInline +value class I(val i: Int) abstract class A { abstract fun f(i: I): String diff --git a/compiler/testData/codegen/box/inlineClasses/mappingOfBoxedFlexibleInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/mappingOfBoxedFlexibleInlineClassType.kt index 6f686d9ce72..dd45fdae298 100644 --- a/compiler/testData/codegen/box/inlineClasses/mappingOfBoxedFlexibleInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/mappingOfBoxedFlexibleInlineClassType.kt @@ -9,10 +9,14 @@ public class JavaClass { // FILE: test.kt -inline class IcInt(val i: Int) -inline class IcLong(val l: Long) -inline class IcAny(val a: Any?) -inline class IcOverIc(val o: IcInt) +@JvmInline +value class IcInt(val i: Int) +@JvmInline +value class IcLong(val l: Long) +@JvmInline +value class IcAny(val a: Any?) +@JvmInline +value class IcOverIc(val o: IcInt) fun box(): String { val i = IcInt(1) diff --git a/compiler/testData/codegen/box/inlineClasses/nestedInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/nestedInlineClass.kt index e3e8528ae0c..6b0ed8590fe 100644 --- a/compiler/testData/codegen/box/inlineClasses/nestedInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/nestedInlineClass.kt @@ -1,19 +1,23 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME class C { - inline class IC1(val s: String) + @JvmInline + value class IC1(val s: String) companion object { - inline class IC2(val s: String) + @JvmInline + value class IC2(val s: String) } } object O { - inline class IC3(val s: String) + @JvmInline + value class IC3(val s: String) } interface I { - inline class IC4(val s: String) + @JvmInline + value class IC4(val s: String) } fun box(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt b/compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt index f79cdd74141..85054fa64b3 100644 --- a/compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt +++ b/compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Result(val a: Any?) +@JvmInline +value class Result(val a: Any?) fun resultOfIntToResultOfInt(r: Result): Result { return r diff --git a/compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt b/compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt index 63b18618ac9..e910ac83b18 100644 --- a/compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt +++ b/compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt @@ -1,6 +1,8 @@ -// !LANGUAGE: +InlineClasses -MangleClassMembersReturningInlineClasses +// WITH_RUNTIME +// !LANGUAGE: -MangleClassMembersReturningInlineClasses -inline class S(val x: String) +@JvmInline +value class S(val x: String) class Test { fun getO() = S("O") diff --git a/compiler/testData/codegen/box/inlineClasses/noReturnTypeManglingJvmName.kt b/compiler/testData/codegen/box/inlineClasses/noReturnTypeManglingJvmName.kt index dccdebca29f..38a0f2ba728 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 -inline class S(val x: String) +@JvmInline +value class S(val x: String) class Test { @Suppress("INAPPLICABLE_JVM_NAME") diff --git a/compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt b/compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt index 1d87365ee16..0abee7c363b 100644 --- a/compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt +++ b/compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z(val value: Int) +@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 a075ffe69a1..292a4eb2342 100644 --- a/compiler/testData/codegen/box/inlineClasses/nullableWrapperEquality.kt +++ b/compiler/testData/codegen/box/inlineClasses/nullableWrapperEquality.kt @@ -1,8 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Z1(val x: String) -inline class ZN(val z: Z1?) -inline class ZN2(val z: ZN) +@JvmInline +value class Z1(val x: String) +@JvmInline +value class ZN(val z: Z1?) +@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 1ca7d80d642..df07654f9a5 100644 --- a/compiler/testData/codegen/box/inlineClasses/overridingFunCallingPrivateFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/overridingFunCallingPrivateFun.kt @@ -1,10 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME interface IFoo { fun foo(): String } -inline class IC(val x: String) : IFoo { +@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 6b6520f44ea..723d6269f6b 100644 --- a/compiler/testData/codegen/box/inlineClasses/passInlineClassAsVararg.kt +++ b/compiler/testData/codegen/box/inlineClasses/passInlineClassAsVararg.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class UInt(val value: Int) +@JvmInline +value class UInt(val value: Int) fun takeVarargs(vararg e: T): T { return e[e.size - 1] diff --git a/compiler/testData/codegen/box/inlineClasses/passInlineClassWithSpreadOperatorToVarargs.kt b/compiler/testData/codegen/box/inlineClasses/passInlineClassWithSpreadOperatorToVarargs.kt index 24bfd7dbd67..d2208cf66e3 100644 --- a/compiler/testData/codegen/box/inlineClasses/passInlineClassWithSpreadOperatorToVarargs.kt +++ b/compiler/testData/codegen/box/inlineClasses/passInlineClassWithSpreadOperatorToVarargs.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class UInt(val value: Int) +@JvmInline +value class UInt(val value: Int) fun last(vararg e: T): T = e[e.size - 1] fun first(vararg e: T): T = e[0] diff --git a/compiler/testData/codegen/box/inlineClasses/privateConstructorFunInterfaceMultiModule.kt b/compiler/testData/codegen/box/inlineClasses/privateConstructorFunInterfaceMultiModule.kt index 6434b3fa631..a11f09d056c 100644 --- a/compiler/testData/codegen/box/inlineClasses/privateConstructorFunInterfaceMultiModule.kt +++ b/compiler/testData/codegen/box/inlineClasses/privateConstructorFunInterfaceMultiModule.kt @@ -1,7 +1,9 @@ // MODULE: lib +// WITH_RUNTIME // FILE: lib.kt -inline class Z private constructor(private val value: Any?) { +@JvmInline +value class Z private constructor(private val value: Any?) { fun result(): String = value as String companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/captureLocalVarDelegatedToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/captureLocalVarDelegatedToInlineClass.kt index b677ce3ab9b..990fa8d605f 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/captureLocalVarDelegatedToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/captureLocalVarDelegatedToInlineClass.kt @@ -1,10 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME var setterInvoked = 0 var backing = 42 -inline class DelegateStr(val ignored: String) { +@JvmInline +value class DelegateStr(val ignored: String) { operator fun getValue(thisRef: Any?, prop: Any?) = backing @@ -15,7 +16,8 @@ inline class DelegateStr(val ignored: String) { } } -inline class DelegateInt(val ignored: Int) { +@JvmInline +value class DelegateInt(val ignored: Int) { operator fun getValue(thisRef: Any?, prop: Any?) = backing @@ -26,7 +28,8 @@ inline class DelegateInt(val ignored: Int) { } } -inline class DelegateLong(val ignored: Long) { +@JvmInline +value class DelegateLong(val ignored: Long) { operator fun getValue(thisRef: Any?, prop: Any?) = backing diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClass.kt index 8cfad98309d..ee73782afb9 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClass.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME class Foo { var a: Int = 42 @@ -7,7 +7,8 @@ class Foo { var setterInvoked = 0 -inline class Delegate(val default: Int) { +@JvmInline +value class Delegate(val default: Int) { operator fun getValue(thisRef: Any?, prop: Any?) = (thisRef as? Foo)?.a ?: default diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClassWithProvideDelegate.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClassWithProvideDelegate.kt index 31533f625a6..fea7b169fdd 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClassWithProvideDelegate.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClassWithProvideDelegate.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME class Foo { var a: Int = 42 @@ -8,14 +8,16 @@ class Foo { var provideDelegateInvoked = 0 var setterInvoked = 0 -inline class DelegateFactory(val default: Int) { +@JvmInline +value class DelegateFactory(val default: Int) { operator fun provideDelegate(thisRef: Any?, prop: Any?): Delegate { provideDelegateInvoked++ return Delegate(default) } } -inline class Delegate(val default: Int) { +@JvmInline +value class Delegate(val default: Int) { operator fun getValue(thisRef: Any?, prop: Any?) = (thisRef as? Foo)?.a ?: default diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateCompanionVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateCompanionVarToInlineClass.kt index 0d8d8c78f4b..7b598dca1d3 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateCompanionVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateCompanionVarToInlineClass.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME class Foo { companion object { @@ -9,7 +9,8 @@ class Foo { var setterInvoked = 0 -inline class Delegate(val ignored: Int) { +@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 1c053910261..07d53ab555b 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateJvmStaticCompanionVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateJvmStaticCompanionVarToInlineClass.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +InlineClasses // TARGET_BACKEND: JVM // WITH_RUNTIME @@ -11,7 +10,8 @@ class Foo { var setterInvoked = 0 -inline class Delegate(val ignored: Int) { +@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 c676535dbfa..8e48f95659e 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateLocalVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateLocalVarToInlineClass.kt @@ -1,10 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME var setterInvoked = 0 var backing = 42 -inline class DelegateStr(val ignored: String) { +@JvmInline +value class DelegateStr(val ignored: String) { operator fun getValue(thisRef: Any?, prop: Any?) = backing @@ -15,7 +16,8 @@ inline class DelegateStr(val ignored: String) { } } -inline class DelegateInt(val ignored: Int) { +@JvmInline +value class DelegateInt(val ignored: Int) { operator fun getValue(thisRef: Any?, prop: Any?) = backing @@ -26,7 +28,8 @@ inline class DelegateInt(val ignored: Int) { } } -inline class DelegateLong(val ignored: Long) { +@JvmInline +value class DelegateLong(val ignored: Long) { operator fun getValue(thisRef: Any?, prop: Any?) = backing diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateObjectVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateObjectVarToInlineClass.kt index 64880c7ee7a..f1eac6c22a5 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateObjectVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateObjectVarToInlineClass.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME object Foo { var a: Int = 42 @@ -7,7 +7,8 @@ object Foo { var setterInvoked = 0 -inline class Delegate(val ignored: Int) { +@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 386a83b8246..8599e930b85 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatePrivateCompanionVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatePrivateCompanionVarToInlineClass.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME class Foo { companion object { @@ -12,7 +12,8 @@ class Foo { var setterInvoked = 0 -inline class Delegate(val ignored: Int) { +@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 8e71f010747..fe7182ed98e 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateTopLevelVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateTopLevelVarToInlineClass.kt @@ -1,9 +1,10 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME var setterInvoked = 0 var backing = 42 -inline class Delegate(val ignored: Int) { +@JvmInline +value class Delegate(val ignored: Int) { operator fun getValue(thisRef: Any?, prop: Any?) = backing diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatedPropertyOfInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatedPropertyOfInlineClassType.kt index f3f308eca92..0ce7d806721 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatedPropertyOfInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatedPropertyOfInlineClassType.kt @@ -1,8 +1,13 @@ +// WITH_RUNTIME + import kotlin.reflect.KProperty -inline class ICInt(val i: Int) -inline class ICLong(val l: Long) -inline class ICOverIC(val o: ICLong) +@JvmInline +value class ICInt(val i: Int) +@JvmInline +value class ICLong(val l: Long) +@JvmInline +value class ICOverIC(val o: ICLong) class Delegate(var f: () -> T) { operator fun getValue(thisRef: Any?, property: KProperty<*>): T = f() diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt27070.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt27070.kt index 17ac0d3d836..5a6b6b43527 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt27070.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt27070.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME import kotlin.properties.ReadOnlyProperty @@ -9,7 +8,8 @@ class Foo { val b by Delegate(0) } -inline class Delegate(val ignored: Int): ReadOnlyProperty { +@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 4c35beb672c..a0279bd8f97 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt42933.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt42933.kt @@ -1,9 +1,11 @@ +// WITH_RUNTIME class Delegate { operator fun getValue(t: Any?, p: Any): String = "OK" } -inline class Kla1(val default: Int) { +@JvmInline +value class Kla1(val default: Int) { fun getValue(): String { val prop by Delegate() return prop diff --git a/compiler/testData/codegen/box/inlineClasses/propertyLoweringOrder.kt b/compiler/testData/codegen/box/inlineClasses/propertyLoweringOrder.kt index e478bf76cbc..8534962caac 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyLoweringOrder.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyLoweringOrder.kt @@ -1,6 +1,8 @@ +// WITH_RUNTIME // FILE: 1.kt -inline class A(val x: String) +@JvmInline +value class A(val x: String) fun accessProperty(y: B): A { y.a = A("OK") diff --git a/compiler/testData/codegen/box/inlineClasses/referToPropertyInCompanionObjectOfInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/referToPropertyInCompanionObjectOfInlineClass.kt index 030e02e2e42..13abb479d62 100644 --- a/compiler/testData/codegen/box/inlineClasses/referToPropertyInCompanionObjectOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/referToPropertyInCompanionObjectOfInlineClass.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Foo(val c: Char) { +@JvmInline +value class Foo(val c: Char) { companion object { val prop = "O" const val constVal = 1 diff --git a/compiler/testData/codegen/box/inlineClasses/referToUnderlyingPropertyInsideInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/referToUnderlyingPropertyInsideInlineClass.kt index 4d468101cab..1b81aef59cf 100644 --- a/compiler/testData/codegen/box/inlineClasses/referToUnderlyingPropertyInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/referToUnderlyingPropertyInsideInlineClass.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class UInt(val value: Int) { +@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 be73e994822..28b7ec30b46 100644 --- a/compiler/testData/codegen/box/inlineClasses/referToUnderlyingPropertyOfInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/referToUnderlyingPropertyOfInlineClass.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class UInt(val value: Int) +@JvmInline +value class UInt(val value: Int) fun box(): String { val a = UInt(123) diff --git a/compiler/testData/codegen/box/inlineClasses/removeInInlineCollectionOfInlineClassAsInt.kt b/compiler/testData/codegen/box/inlineClasses/removeInInlineCollectionOfInlineClassAsInt.kt index 44f27d2979e..6731d2edb6f 100644 --- a/compiler/testData/codegen/box/inlineClasses/removeInInlineCollectionOfInlineClassAsInt.kt +++ b/compiler/testData/codegen/box/inlineClasses/removeInInlineCollectionOfInlineClassAsInt.kt @@ -1,12 +1,15 @@ // WITH_RUNTIME -inline class Z(val x: Int) +@JvmInline +value class Z(val x: Int) -inline class Z2(val x: Z) +@JvmInline +value class Z2(val x: Z) fun z2(x: Int) = Z2(Z(x)) -inline class ZMutableCollection(private val ms: MutableCollection) : MutableCollection { +@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) override fun clear() { ms.clear() } @@ -20,7 +23,8 @@ inline class ZMutableCollection(private val ms: MutableCollection) : MutableC override fun isEmpty(): Boolean = ms.isEmpty() } -inline class Z2MutableCollection(private val ms: MutableCollection) : MutableCollection { +@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) override fun clear() { ms.clear() } diff --git a/compiler/testData/codegen/box/inlineClasses/result.kt b/compiler/testData/codegen/box/inlineClasses/result.kt index c936919f5ce..4d6aec4f6e6 100644 --- a/compiler/testData/codegen/box/inlineClasses/result.kt +++ b/compiler/testData/codegen/box/inlineClasses/result.kt @@ -2,10 +2,12 @@ // IGNORE_BACKEND: ANDROID // IGNORE_BACKEND: NATIVE // ALLOW_KOTLIN_PACKAGE +// WITH_RUNTIME // FILE: result.kt package kotlin -inline class Result(val value: Any?) +@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 7ac24bd4cdc..8b5fb25ec81 100644 --- a/compiler/testData/codegen/box/inlineClasses/resultRunCatchingOrElse.kt +++ b/compiler/testData/codegen/box/inlineClasses/resultRunCatchingOrElse.kt @@ -1,7 +1,10 @@ // IGNORE_BACKEND: WASM // WASM_MUTE_REASON: TYPE_ISSUES +// WITH_RUNTIME -inline class Result(val value: Any?) { + +@JvmInline +value class Result(val value: Any?) { fun exceptionOrNull(): Throwable? = when (value) { is Failure -> value.exception diff --git a/compiler/testData/codegen/box/inlineClasses/safeAsOfTypeParameterWithInlineClassBound.kt b/compiler/testData/codegen/box/inlineClasses/safeAsOfTypeParameterWithInlineClassBound.kt index de62f6b8017..1514cfa4eb3 100644 --- a/compiler/testData/codegen/box/inlineClasses/safeAsOfTypeParameterWithInlineClassBound.kt +++ b/compiler/testData/codegen/box/inlineClasses/safeAsOfTypeParameterWithInlineClassBound.kt @@ -1,7 +1,9 @@ // IGNORE_BACKEND: JVM +// WITH_RUNTIME interface X -inline class Z(val value: Int) : X +@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 c063dbe68f2..78641a06e94 100644 --- a/compiler/testData/codegen/box/inlineClasses/secondaryConstructorWithVararg.kt +++ b/compiler/testData/codegen/box/inlineClasses/secondaryConstructorWithVararg.kt @@ -1,7 +1,7 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class Z(val x: Int) { +@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 0ea5b0e9afc..b91fc0b122e 100644 --- a/compiler/testData/codegen/box/inlineClasses/secondaryConstructorsInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/secondaryConstructorsInsideInlineClass.kt @@ -1,10 +1,11 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME @file:Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_INLINE_CLASS") var global = "wrong" -inline class Foo(val x: String) { +@JvmInline +value class Foo(val x: String) { constructor(y: Int) : this(y.toString()) constructor(z: Long) : this(z.toInt() + 1) constructor(other: Char) : this(other.toInt().toString()) { diff --git a/compiler/testData/codegen/box/inlineClasses/secondaryConstructorsInsideInlineClassWithPrimitiveCarrierType.kt b/compiler/testData/codegen/box/inlineClasses/secondaryConstructorsInsideInlineClassWithPrimitiveCarrierType.kt index d9d4d783f20..7388b67992d 100644 --- a/compiler/testData/codegen/box/inlineClasses/secondaryConstructorsInsideInlineClassWithPrimitiveCarrierType.kt +++ b/compiler/testData/codegen/box/inlineClasses/secondaryConstructorsInsideInlineClassWithPrimitiveCarrierType.kt @@ -1,8 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME var global = "wrong" -inline class Foo(val x: Int) { +@JvmInline +value class Foo(val x: Int) { constructor(y: String) : this(y.length) constructor(z: Long) : this(z.toInt() + 1) diff --git a/compiler/testData/codegen/box/inlineClasses/simpleSecondaryConstructor.kt b/compiler/testData/codegen/box/inlineClasses/simpleSecondaryConstructor.kt index 5e2fc1497a7..cbf1f5ebd67 100644 --- a/compiler/testData/codegen/box/inlineClasses/simpleSecondaryConstructor.kt +++ b/compiler/testData/codegen/box/inlineClasses/simpleSecondaryConstructor.kt @@ -2,11 +2,12 @@ // WASM_MUTE_REASON: IGNORED_IN_JS // IGNORE_BACKEND: JS, JS_IR, NATIVE, JVM // IGNORE_BACKEND: JS_IR_ES6 -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME @file:Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_INLINE_CLASS") -inline class Foo(val x: String) { +@JvmInline +value class Foo(val x: String) { constructor(y: Int) : this("OK") { if (y == 0) return throw java.lang.IllegalArgumentException() if (y == 1) return diff --git a/compiler/testData/codegen/box/inlineClasses/smartCastOnThisOfInlineClassType.kt b/compiler/testData/codegen/box/inlineClasses/smartCastOnThisOfInlineClassType.kt index 2102d77b698..9f09356580c 100644 --- a/compiler/testData/codegen/box/inlineClasses/smartCastOnThisOfInlineClassType.kt +++ b/compiler/testData/codegen/box/inlineClasses/smartCastOnThisOfInlineClassType.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME interface IBase { fun testDefault1() = if (this is B) this.foo() else "fail" @@ -10,7 +10,8 @@ interface IFoo : IBase { fun testDefault2() = if (this is B) this.foo() else "fail" } -inline class B(val x: String) : IFoo { +@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 37fd5117c83..9727f1e5b16 100644 --- a/compiler/testData/codegen/box/inlineClasses/stringPlus.kt +++ b/compiler/testData/codegen/box/inlineClasses/stringPlus.kt @@ -1,8 +1,9 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun foo(a: IC): T = a.value as T -inline class IC(val value: String) +@JvmInline +value class IC(val value: String) fun box(): String { return foo(IC("O")) + "K" diff --git a/compiler/testData/codegen/box/inlineClasses/toStringCallingPrivateFun.kt b/compiler/testData/codegen/box/inlineClasses/toStringCallingPrivateFun.kt index d596194b4b4..c9f01b66649 100644 --- a/compiler/testData/codegen/box/inlineClasses/toStringCallingPrivateFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/toStringCallingPrivateFun.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class IC(val x: String) { +@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 fafb9d1de16..f38fc8fad91 100644 --- a/compiler/testData/codegen/box/inlineClasses/toStringOfUnboxedNullable.kt +++ b/compiler/testData/codegen/box/inlineClasses/toStringOfUnboxedNullable.kt @@ -1,7 +1,8 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME // IGNORE_BACKEND: JVM // IGNORE_LIGHT_ANALYSIS -inline class IC(val x: String) +@JvmInline +value class IC(val x: String) fun IC?.foo() = toString() // `IC?` unboxed into `String?` fun IC?.bar() = "$this" diff --git a/compiler/testData/codegen/box/inlineClasses/typeChecksForInlineClasses.kt b/compiler/testData/codegen/box/inlineClasses/typeChecksForInlineClasses.kt index 3eabb0d0d8a..7dcfdcb33e6 100644 --- a/compiler/testData/codegen/box/inlineClasses/typeChecksForInlineClasses.kt +++ b/compiler/testData/codegen/box/inlineClasses/typeChecksForInlineClasses.kt @@ -1,12 +1,14 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class AsAny(val a: Any?) { +@JvmInline +value class AsAny(val a: Any?) { fun myEq(other: Any?): Boolean { return other is AsAny && other.a == a } } -inline class AsInt(val a: Int) { +@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 555df6d08ae..7545a29866a 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/any.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/any.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a) { it.value as T @@ -28,7 +28,8 @@ fun bar(value: T, f: FunIFace): R { return f.call(value) } -inline class IC(val value: Any) { +@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 a13cbf30be8..3b299921905 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/anyN.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/anyN.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a) { it.value as T @@ -28,7 +28,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -inline class IC(val value: Any?) { +@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 97146b302bf..2ea9e73a76c 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/iface.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/iface.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a) { (it.value as FooHolder).value as T @@ -32,7 +32,8 @@ interface Foo class FooHolder(val value: Any): Foo -inline class IC(val value: Foo): Foo { +@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 a2368761b61..48925807d1d 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/ifaceChild.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/ifaceChild.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a) { (it.value as FooHolder).value as T @@ -32,7 +32,8 @@ interface Foo class FooHolder(val value: Any): Foo -inline class IC(val value: FooHolder): Foo { +@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/nullableResult.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/nullableResult.kt index 3a59a80d322..8f9a9bafb52 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/nullableResult.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/nullableResult.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME fun foo(a: Result?): T? = bar(a) { diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/primitive.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/primitive.kt index 05c0d999fda..ffa674b5eb6 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/primitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/primitive.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T1 = bar(a) { it.value as T1 } @@ -20,7 +20,8 @@ fun IC.extensionValue(): T6 = value as T6 fun normalValue(ic: IC): T7 = ic.value as T7 -inline class IC(val value: Int) { +@JvmInline +value class IC(val value: Int) { fun dispatchValue(): T8 = value as T8 } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/result.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/result.kt index 4537fa84cf7..df2c5c51afe 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/result.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/result.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME fun foo(a: Result): T = bar(a) { diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/resultAny.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/resultAny.kt index 8ed679143c3..4e04f2f9a89 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/resultAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/resultAny.kt @@ -1,7 +1,7 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class IC(val value: Any) +@JvmInline +value class IC(val value: Any) fun foo(a: Result, ic: IC): Pair = bar(a, ic) { a, ic -> a.getOrThrow() to ic.value diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/string.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/string.kt index 9d84cf1a01c..75d17959660 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/string.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/funInterface/string.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a) { it.value as T @@ -28,7 +28,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -inline class IC(val value: String) { +@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 5aaa8f9e26c..24e0edf6f8f 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/any.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/any.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a) { it.value as T @@ -24,7 +24,8 @@ fun bar(value: T, f: (T) -> R): R { return f(value) } -inline class IC(val value: Any) { +@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 785383cd6b9..3b3d3e1dc57 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/anyN.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/anyN.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a) { it.value as T @@ -24,7 +24,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -inline class IC(val value: Any?) { +@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 86920af319e..c91568f8cf8 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/iface.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/iface.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a) { (it.value as FooHolder).value as T @@ -28,7 +28,8 @@ interface Foo class FooHolder(val value: Any): Foo -inline class IC(val value: Foo): Foo { +@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 33e9a41beb3..825a6e3cd3a 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/ifaceChild.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/ifaceChild.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a) { (it.value as FooHolder).value as T @@ -28,7 +28,8 @@ interface Foo class FooHolder(val value: Any): Foo -inline class IC(val value: FooHolder): Foo { +@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/nullableResult.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/nullableResult.kt index b0f1684ee3c..fade59e7cce 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/nullableResult.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/nullableResult.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME fun foo(a: Result?): T? = bar(a) { diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/primitive.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/primitive.kt index 40faf36197b..26e2633391d 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/primitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/primitive.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a) { it.value as T @@ -24,7 +24,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -inline class IC(val value: Int) { +@JvmInline +value class IC(val value: Int) { fun dispatchValue(): T = value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/result.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/result.kt index 38e8b625326..3d7f972343a 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/result.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/result.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME fun foo(a: Result): T = bar(a) { diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/resultAny.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/resultAny.kt index 7743341b618..1a0c5da866c 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/resultAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/resultAny.kt @@ -1,7 +1,7 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class IC(val value: Any) +@JvmInline +value class IC(val value: Any) fun foo(a: Result, ic: IC): Pair = bar(a, ic) { a, ic -> a.getOrThrow() to ic.value diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/string.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/string.kt index 0922f4ef605..2afdf0df209 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/string.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/lambda/string.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a) { it.value as T @@ -24,7 +24,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -inline class IC(val value: String) { +@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 56220dcecba..f1aa528b256 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/any.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/any.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a, object : IFace { override fun call(ic: IC): T = ic.value as T @@ -28,7 +28,8 @@ fun bar(value: T, f: IFace): R { return f.call(value) } -inline class IC(val value: Any) { +@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 ab7e77f8e9b..64765d03542 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/anyN.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/anyN.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a, object : IFace { override fun call(ic: IC): T = ic.value as T @@ -28,7 +28,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -inline class IC(val value: Any?) { +@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 f537e499007..4cd031f919c 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/iface.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/iface.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a, object : IFace { override fun call(ic: IC): T = (ic.value as FooHolder).value as T @@ -32,7 +32,8 @@ interface Foo class FooHolder(val value: Any): Foo -inline class IC(val value: Foo): Foo { +@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 11f4c1bb07f..070f892832e 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/ifaceChild.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/ifaceChild.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a, object : IFace { override fun call(ic: IC): T = (ic.value as FooHolder).value as T @@ -32,7 +32,8 @@ interface Foo class FooHolder(val value: Any): Foo -inline class IC(val value: FooHolder): Foo { +@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/nullableResult.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/nullableResult.kt index 2a9acadd96e..9ed4baf16ae 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/nullableResult.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/nullableResult.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME // IGNORE_BACKEND: JVM // IGNORE_LIGHT_ANALYSIS diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/primitive.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/primitive.kt index c6f7ec60ff7..dbf83ea60e2 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/primitive.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/primitive.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a, object : IFace { override fun call(ic: IC): T = ic.value as T @@ -28,7 +28,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -inline class IC(val value: Int) { +@JvmInline +value class IC(val value: Int) { fun dispatchValue(): T = value as T } diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/result.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/result.kt index 23d285cae90..f2a0d10bdd2 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/result.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/result.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME fun foo(a: Result): T = bar(a, object : IFace, T> { diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/resultAny.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/resultAny.kt index 07c6d7404e6..b31b2f066c8 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/resultAny.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/resultAny.kt @@ -1,7 +1,7 @@ -// !LANGUAGE: +InlineClasses // WITH_RUNTIME -inline class IC(val value: Any) +@JvmInline +value class IC(val value: Any) fun foo(a: Result, ic: IC): Pair = bar(a, ic, object : IFace, IC, Pair> { override fun call(a: Result, ic: IC): Pair = a.getOrThrow() to ic.value diff --git a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/string.kt b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/string.kt index 2a911bc1760..03e5dfc601b 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/string.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxGenericParameter/objectLiteral/string.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME fun underlying(a: IC): T = bar(a, object : IFace { override fun call(ic: IC): T = ic.value as T @@ -28,7 +28,8 @@ fun IC.extensionValue(): T = value as T fun normalValue(ic: IC): T = ic.value as T -inline class IC(val value: String) { +@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 e120b9bb983..e4f510e04e3 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME class BoxT(val boxed: T) class BoxAny(val boxed: Any?) @@ -6,11 +6,14 @@ class BoxFoo(val boxed: IFoo?) interface IFoo -inline class Str(val value: String) : IFoo +@JvmInline +value class Str(val value: String) : IFoo -inline class Str2(val value: Str): IFoo +@JvmInline +value class Str2(val value: Str): IFoo -inline class StrArr(val value: Array): IFoo +@JvmInline +value class StrArr(val value: Array): IFoo fun boxToTypeParameter(x: Str?) = BoxT(x) fun boxToNullableAny(x: Str?) = BoxAny(x) diff --git a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt index 6aad0a492d2..b1d2b8f0e6d 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME class BoxT(val boxed: T) class BoxAny(val boxed: Any?) @@ -6,7 +6,8 @@ class BoxFoo(val boxed: IFoo?) interface IFoo -inline class I32(val value: Int) : IFoo +@JvmInline +value class I32(val value: Int) : IFoo fun boxToTypeParameter(x: I32?) = BoxT(x) fun boxToNullableAny(x: I32?) = BoxAny(x) diff --git a/compiler/testData/codegen/box/inlineClasses/unboxParameterOfSuspendLambdaBeforeInvoke.kt b/compiler/testData/codegen/box/inlineClasses/unboxParameterOfSuspendLambdaBeforeInvoke.kt index 2e133046c11..ee97f623005 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxParameterOfSuspendLambdaBeforeInvoke.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxParameterOfSuspendLambdaBeforeInvoke.kt @@ -9,13 +9,16 @@ import helpers.* import kotlin.coroutines.* import kotlin.coroutines.intrinsics.* -inline class BoxAny(val value: Any?) { +@JvmInline +value class BoxAny(val value: Any?) { val intValue: Int get() = value as Int } -inline class BoxInt(val value: Int) +@JvmInline +value class BoxInt(val value: Int) -inline class BoxLong(val value: Long) +@JvmInline +value class BoxLong(val value: Long) class EmptyContinuation : Continuation { override val context: CoroutineContext diff --git a/compiler/testData/codegen/box/inlineClasses/unboxReceiverOnCallingMethodFromInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/unboxReceiverOnCallingMethodFromInlineClass.kt index afc86bc516c..7010ef6bd3c 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxReceiverOnCallingMethodFromInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxReceiverOnCallingMethodFromInlineClass.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Foo(val s: Any) { +@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 9293618df13..84a97f90f6a 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 -inline class SnekDirection(val direction: Int) { +@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 2cc887c0725..ed91a19edc9 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxValueOfAnyBeforeMethodInvocation.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxValueOfAnyBeforeMethodInvocation.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME -inline class NullableInt(private val holder: Any?) { +@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 5dab07739c3..9356a87827e 100644 --- a/compiler/testData/codegen/box/inlineClasses/useInlineClassesInsideElvisOperator.kt +++ b/compiler/testData/codegen/box/inlineClasses/useInlineClassesInsideElvisOperator.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class UInt(private val u: Int) { +@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 07902a77ebf..8d00bf20f43 100644 --- a/compiler/testData/codegen/box/inlineClasses/useInlineFunctionInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/useInlineFunctionInsideInlineClass.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class Foo(val a: String) { +@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 6779b3fab34..fee4b1fa870 100644 --- a/compiler/testData/codegen/box/inlineClasses/useOfInlineClassWithGenericMethodFromJava.kt +++ b/compiler/testData/codegen/box/inlineClasses/useOfInlineClassWithGenericMethodFromJava.kt @@ -1,8 +1,10 @@ // TARGET_BACKEND: JVM +// WITH_RUNTIME // FILE: a.kt -inline class IC(val v: Int) { +@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 e6f3992e850..da8592f67ca 100644 --- a/compiler/testData/codegen/box/inlineClasses/useThisInsideInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/useThisInsideInlineClass.kt @@ -1,6 +1,7 @@ -// !LANGUAGE: +InlineClasses +// WITH_RUNTIME -inline class UInt(val a: Int) { +@JvmInline +value class UInt(val a: Int) { fun test() { takeNullable(this) takeAnyInside(this) diff --git a/compiler/testData/codegen/box/inlineClasses/whenWithSubject.kt b/compiler/testData/codegen/box/inlineClasses/whenWithSubject.kt index 4da791e7909..58feab6df6a 100644 --- a/compiler/testData/codegen/box/inlineClasses/whenWithSubject.kt +++ b/compiler/testData/codegen/box/inlineClasses/whenWithSubject.kt @@ -1,4 +1,7 @@ -inline class InlineLong(val value: Long) +// WITH_RUNTIME + +@JvmInline +value class InlineLong(val value: Long) inline val Number.toInlineLong get() = InlineLong(this.toLong()) fun box(): String {