Support inline functions inside inline classes

This commit is contained in:
Mikhail Zarechenskiy
2018-05-07 04:09:06 +03:00
parent 5c57c799fc
commit b25a1d9522
13 changed files with 161 additions and 5 deletions
@@ -0,0 +1,23 @@
// !LANGUAGE: +InlineClasses
// FILE: 1.kt
package test
inline class A(val x: Int) {
inline fun inc(): A = A(this.x + 1)
inline fun result(other: A): String = if (other.x == x) "OK" else "fail"
}
// FILE: 2.kt
import test.*
fun box() : String {
val a = A(0)
val b = a.inc().inc()
val result = b.result(A(2))
return result
}