mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 08:31:35 +00:00
16 lines
265 B
Kotlin
Vendored
16 lines
265 B
Kotlin
Vendored
interface Callable<T> {
|
|
fun call(): T
|
|
}
|
|
|
|
fun foo(a: Int): Int {
|
|
// SIBLING:
|
|
val o = <selection>object: Callable<Int> {
|
|
val b: Int = 1
|
|
|
|
override fun call(): Int {
|
|
return a + b
|
|
}
|
|
}</selection>
|
|
return o.call()
|
|
}
|