mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
20 lines
282 B
Kotlin
Vendored
20 lines
282 B
Kotlin
Vendored
// FILE: MFunction.java
|
|
|
|
public interface MFunction<T, R> {
|
|
R invoke(T t);
|
|
}
|
|
|
|
// FILE: 1.kt
|
|
|
|
|
|
object Foo {
|
|
class Requester(val dealToBeOffered: String)
|
|
}
|
|
|
|
class Bar {
|
|
val foo = MFunction(Foo::Requester)
|
|
}
|
|
|
|
fun box(): String {
|
|
return Bar().foo("OK").dealToBeOffered
|
|
} |