Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/interfaceDelegation/memberFunDelegatedToInlineClassLong.kt
T
2021-12-15 17:14:22 +00:00

22 lines
400 B
Kotlin
Vendored

// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
import kotlin.test.assertEquals
interface IFoo {
fun foo(s: String): String
}
OPTIONAL_JVM_INLINE_ANNOTATION
value class Z(val x: Long) : IFoo {
override fun foo(s: String): String = x.toString() + s
}
class Test(x: Long) : IFoo by Z(x)
fun box(): String {
assertEquals("1OK", Test(1L).foo("OK"))
return "OK"
}