mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-18 08:31:38 +00:00
Migrate boxWithJava tests to multi-file framework
This commit is contained in:
25
compiler/testData/codegen/boxWithJava/innerGenericClass.kt
vendored
Normal file
25
compiler/testData/codegen/boxWithJava/innerGenericClass.kt
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// FILE: JavaClass.java
|
||||
|
||||
public abstract class JavaClass {
|
||||
public static String test() {
|
||||
return Test.INSTANCE.foo(new Outer<String>("OK").new Inner<Integer>(1));
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Kotlin.kt
|
||||
|
||||
class Outer<E>(val x: E) {
|
||||
inner class Inner<F>(val y: F) {
|
||||
fun foo() = x.toString() + y.toString()
|
||||
}
|
||||
}
|
||||
|
||||
object Test {
|
||||
fun foo(x: Outer<String>.Inner<Integer>) = x.foo()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result = JavaClass.test()
|
||||
if (result != "OK1") return "Fail: $result"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user