// WITH_STDLIB // IGNORE_BACKEND: JVM // WORKS_WHEN_VALUE_CLASS // LANGUAGE: +ValueClasses, +GenericInlineClassParameter interface IFoo { fun foo(): String = "K" } OPTIONAL_JVM_INLINE_ANNOTATION value class IcStr(val y: T) : IFoo { override fun foo(): String = y + super.foo() } OPTIONAL_JVM_INLINE_ANNOTATION value class IcInt(val i: T) : IFoo { override fun foo(): String = "O" + super.foo() } OPTIONAL_JVM_INLINE_ANNOTATION value class IcLong(val l: T) : IFoo { override fun foo(): String = "O" + super.foo() } OPTIONAL_JVM_INLINE_ANNOTATION value class IcAny(val a: T?) : IFoo { override fun foo(): String = "O" + super.foo() } OPTIONAL_JVM_INLINE_ANNOTATION value class IcOverIc>(val o: T) : IFoo { override fun foo(): String = "O" + super.foo() } OPTIONAL_JVM_INLINE_ANNOTATION value class IcOverSuperInterface(val x: T) : IFoo { override fun foo(): String = "O" + super.foo() } fun check(message: String, iFoo: IFoo) { val actual = iFoo.foo() if (actual != "OK") throw Exception("$message: \"$actual\" != OK") } fun box(): String { check("IcStr", IcStr("O")) check("IcInt", IcInt(42)) check("IcLong", IcLong(42L)) check("IcAny", IcAny("")) check("IcOverIc", IcOverIc(IcLong(42L))) check("IcOverSuperInterface", IcOverSuperInterface(IcInt(42))) return "OK" }