44bc937499
#KT-10102
13 lines
401 B
Kotlin
Vendored
13 lines
401 B
Kotlin
Vendored
class T {
|
|
interface Factory {
|
|
operator fun invoke(i: Int): IntPredicate
|
|
|
|
companion object {
|
|
inline operator fun invoke(crossinline f: (Int) -> IntPredicate) = object : Factory {
|
|
override fun invoke(i: Int) = f(i)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
<selection>fun foo(): T.Factory = T.Factory.Companion { k -> IntPredicate { n -> n % k == 0 } }</selection> |