mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
19 lines
455 B
Kotlin
Vendored
19 lines
455 B
Kotlin
Vendored
// FILE: JavaClass.java
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Comparator;
|
|
|
|
class JavaClass {
|
|
public static String foo(Comparator<String> comparator) {
|
|
return Arrays.toString(comparator.getClass().getGenericInterfaces());
|
|
}
|
|
}
|
|
|
|
// FILE: 1.kt
|
|
|
|
fun box(): String {
|
|
val supertypes = JavaClass.foo { a, b -> a.compareTo(b) }
|
|
if (supertypes != "[java.util.Comparator<java.lang.String>]") return "Fail: $supertypes"
|
|
return "OK"
|
|
}
|