Minor. Add tests to check returning inline class from default method
#KT-45539 Obsolete
This commit is contained in:
+15
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user