Inline (wrapper) class IC extends erased inline class IC$Erased
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
interface IFoo {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
inline class IC(val x: String) : IFoo {
|
||||
private fun privateFun() = x
|
||||
override fun foo() = privateFun()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val x: IFoo = IC("OK")
|
||||
return x.foo()
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
inline class IC(val x: String) {
|
||||
private fun privateFun() = x
|
||||
override fun toString() = privateFun()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val x: Any = IC("OK")
|
||||
return x.toString()
|
||||
}
|
||||
Reference in New Issue
Block a user