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 InlinedComparable(val x: Int) : Comparable<InlinedComparable> {
@JvmInline
value class InlinedComparable(val x: Int) : Comparable<InlinedComparable> {
override fun compareTo(other: InlinedComparable): Int {
return x.compareTo(other.x)
}
@@ -12,7 +13,8 @@ interface Base<T> {
fun Base<T>.foo(a: Base<T>, b: T): Base<T>
}
inline class InlinedBase(val x: Int) : Base<InlinedBase> {
@JvmInline
value class InlinedBase(val x: Int) : Base<InlinedBase> {
override fun Base<InlinedBase>.foo(a: Base<InlinedBase>, b: InlinedBase): Base<InlinedBase> {
return if (a is InlinedBase) InlinedBase(a.x + b.x) else this
}