mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 08:31:29 +00:00
17 lines
267 B
Kotlin
Vendored
17 lines
267 B
Kotlin
Vendored
// !LANGUAGE: +InlineClasses
|
|
|
|
inline class Foo(val s: Any) {
|
|
fun isString(): Boolean = s is String
|
|
}
|
|
|
|
class Box<T>(val x: T)
|
|
|
|
fun box(): String {
|
|
val f = Foo("string")
|
|
val g = Box(f)
|
|
val r = g.x.isString()
|
|
|
|
if (!r) return "Fail"
|
|
|
|
return "OK"
|
|
} |