3438d19c22
KT-44278 KT-26060 KT-42621
18 lines
402 B
Kotlin
Vendored
18 lines
402 B
Kotlin
Vendored
// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS
|
|
// WITH_SIGNATURES
|
|
// FILE: t.kt
|
|
fun main(x: DataStream<Int>) {
|
|
x.keyBy({ it.toLong() })
|
|
x.keyBy(KeySelector<Int, Long>{ it.toLong() })
|
|
}
|
|
|
|
// FILE: KeySelector.java
|
|
public interface KeySelector<IN, KEY> {
|
|
KEY getKey(IN value);
|
|
}
|
|
|
|
// FILE: DataStream.java
|
|
public class DataStream<T> {
|
|
public <K> void keyBy(KeySelector<T,K> key) {}
|
|
}
|