9 lines
118 B
Kotlin
9 lines
118 B
Kotlin
trait A {
|
|
val method : (() -> Unit)?
|
|
}
|
|
|
|
fun test(a : A) {
|
|
if (a.method != null) {
|
|
a.method!!()
|
|
}
|
|
} |