package Jet87 open class A() { fun foo() : Int = 1 } interface B { fun bar() : Double = 1.0; } interface G { val <X> boo: Double where X : A, X : B val <A> bal: Double where A : B val <Y> bas: Double where Y : B, X : B } class C() : A(), B class D() { companion object : A(), B {} } class Test1() where T : A, T : B, B : T // error { fun test(t : T) { T.foo() T.bar() t.foo() t.bar() } } fun test() { Test1<B>() Test1<A>() Test1() } class Foo() {} class BarFoo> class Buzz where T : Bar<Int>, T : nioho class XFoo> class Y<T> where T : Foo, T : Bar fun test2(t : T) where T : A, T : B, B : T { T.foo() T.bar() t.foo() t.bar() } val t1 = test2<A>(A()) val t2 = test2<B>(C()) val t3 = test2(C()) val <T, B : T> x : Int = 0