Minor. Add tests to check returning inline class from default method

#KT-45539 Obsolete
This commit is contained in:
Ilmir Usmanov
2021-04-12 10:32:06 +02:00
parent 8c464b4de5
commit 19b1b48e87
9 changed files with 58 additions and 0 deletions
@@ -0,0 +1,15 @@
// IGNORE_BACKEND: JVM
interface X<T> {
operator fun plus(n: Int) : T
fun next(): T = this + 1
}
inline class A(val value: Int) : X<A> {
override operator fun plus(n: Int) = A(value + n)
}
fun box(): String {
val res = A(1).next()
return if (res.value == 2) "OK" else "FAIL $res"
}