mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-07 08:31:28 +00:00
20 lines
270 B
Kotlin
Vendored
20 lines
270 B
Kotlin
Vendored
abstract class A {
|
|
inner class InnerInA {
|
|
fun returnOk() = "OK"
|
|
}
|
|
}
|
|
|
|
class B : A()
|
|
|
|
fun foo(a: A): String {
|
|
if (a is B) {
|
|
val v = a::InnerInA
|
|
return v().returnOk()
|
|
}
|
|
|
|
return "error"
|
|
}
|
|
|
|
fun box(): String {
|
|
return foo(B())
|
|
} |