=== tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraintTransitively2.ts === // using a type parameter as a constraint for a type parameter is invalid // these should be errors at the type parameter constraint declarations, and have no downstream errors interface A { foo: number } >A : A >foo : number interface B extends A { bar: string; } >B : B >A : A >bar : string interface C extends B { baz: boolean; } >C : C >B : B >baz : boolean var a: A; >a : A >A : A var b: B; >b : B >B : B var c: C; >c : C >C : C function foo(x: T, y: U, z: V): V { return z; } >foo : (x: T, y: U, z: V) => V >T : T >U : U >V : V >x : T >T : T >y : U >U : U >z : V >V : V >V : V >z : V //function foo(x: T, y: U, z: V): V { return z; } foo(1, 2, ''); >foo(1, 2, '') : string >foo : (x: T, y: U, z: V) => V >1 : number >2 : number >'' : string foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: 2, z: true }); >foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: 2, z: true }) : { x: number; y: number; z: boolean; } >foo : (x: T, y: U, z: V) => V >{ x: 1 } : { x: number; } >x : number >1 : number >{ x: 1, y: '' } : { x: number; y: string; } >x : number >1 : number >y : string >'' : string >{ x: 2, y: 2, z: true } : { x: number; y: number; z: boolean; } >x : number >2 : number >y : number >2 : number >z : boolean >true : boolean foo(a, b, a); >foo(a, b, a) : A >foo : (x: T, y: U, z: V) => V >a : A >b : B >a : A foo(a, { foo: 1, bar: '', hm: true }, b); >foo(a, { foo: 1, bar: '', hm: true }, b) : B >foo : (x: T, y: U, z: V) => V >a : A >{ foo: 1, bar: '', hm: true } : { foo: number; bar: string; hm: boolean; } >foo : number >1 : number >bar : string >'' : string >hm : boolean >true : boolean >b : B foo((x: number, y: string) => { }, (x, y: boolean) => { }, () => { }); >foo((x: number, y: string) => { }, (x, y: boolean) => { }, () => { }) : () => void >foo : (x: T, y: U, z: V) => V >(x: number, y: string) => { } : (x: number, y: string) => void >x : number >y : string >(x, y: boolean) => { } : (x: any, y: boolean) => void >x : any >y : boolean >() => { } : () => void function foo2(x: T, y: U, z: V): V { return z; } >foo2 : (x: T, y: U, z: V) => V >T : T >A : A >U : U >A : A >V : V >A : A >x : T >T : T >y : U >U : U >z : V >V : V >V : V >z : V //function foo2(x: T, y: U, z: V): V { return z; } foo(b, a, c); >foo(b, a, c) : C >foo : (x: T, y: U, z: V) => V >b : B >a : A >c : C foo(c, c, a); >foo(c, c, a) : A >foo : (x: T, y: U, z: V) => V >c : C >c : C >a : A