declare class Foo extends Qux mixins Bar { // KeyedCollection <: Collection // ...KeyedIterable } declare class Bar extends Baz { // KeyedIterable <: Iterable y: T } declare class Qux extends Baz { // Collection <: Iterable y: T, z: T } declare class Baz { // Iterable x: T } ((new Foo).x: number); // error: Qux wins ((new Foo).y: string); // error: Bar wins ((new Foo).z: number); // error: Qux wins