// FILE: J.java public class J { public static int test1() { A> x = new X>("O", new B("K")); return A.DefaultImpls.test1(x, 1, 1.0); } public static A> test2(){ X> x = new X>("O", new B("K")); return A.DefaultImpls.test2(x, 1); } } // FILE: K.kt class B(val value: T) interface A> { fun test1(p: T, z: L): T { return p } fun test2(p: L): A { return this } } class X>(val p1: T, val p2: Y) : A { } fun box(): String { val test1 = J.test1() if (test1 != 1) return "fail 1: $test1 != 1" val test2: X> = J.test2() as X> return test2.p1 + test2.p2.value }