Files
kotlin/compiler/testData/codegen/boxWithJava/casts/literalExpressionAsGenericArgument.kt
2016-03-02 15:47:38 +03:00

25 lines
404 B
Kotlin
Vendored

// FILE: Box.java
public class Box<T> {
private final T value;
public Box(T value) {
this.value = value;
}
public static <T> Box<T> create(T defaultValue) {
return new Box(defaultValue);
}
public T getValue() {
return value;
}
}
// FILE: test.kt
fun box(): String {
val sub = Box<Long>(-1)
return if (sub.value == -1L) "OK" else "fail"
}