Replaced deprecated inline classes with JvmInline value classes in tests

This commit is contained in:
zhelenskiy
2021-10-09 02:31:28 +03:00
committed by TeamCityServer
parent b0aefd543a
commit 1da46586bd
386 changed files with 1480 additions and 840 deletions
@@ -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
@@ -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
@@ -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
@@ -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()
}
@@ -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 <R> withDefaultZ(fn: (Z) -> R, x: Z = Z(42)) = fn(x)
inline fun <R> withDefaultL(fn: (L) -> R, x: L = L(42L)) = fn(x)
@@ -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 <R> withDefaultZ(fn: (Z) -> R, x: Z = Z(xx)) = fn(x)
inline fun <R> withDefaultL(fn: (L) -> R, x: L = L(xx.toLong())) = fn(x)
inline fun <R> withDefaultL2(x: L = L(xx.toLong()), fn: (L) -> R) = fn(x)
@@ -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
}
@@ -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()
@@ -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
@@ -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())
}
@@ -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)
@@ -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
}
@@ -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 =
@@ -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 =
@@ -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 =
@@ -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 =