==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts (18 errors) ==== // Type parameters are in scope in their own and other type parameter lists // Nested local functions function foo(x: T, y: U) { ~~~~~~~~~~~ !!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function bar() { function baz(a: X, b: Y): T { x = y; ~ !!! Type 'U' is not assignable to type 'T'. return y; ~ !!! Type 'U' is not assignable to type 'T'. } } } function foo2(x: T, y: U) { ~~~~~~~~~~~ !!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function bar() { function baz(a: X, b: Y): T { x = y; ~ !!! Type 'U' is not assignable to type 'T'. return y; ~ !!! Type 'U' is not assignable to type 'T'. } } } var f = function (x: T, y: U) { ~~~~~~~~~~~ !!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function bar() { var g = function (a: X, b: Y): T { x = y; ~ !!! Type 'U' is not assignable to type 'T'. return y; ~ !!! Type 'U' is not assignable to type 'T'. } } } var f2 = function (x: T, y: U) { ~~~~~~~~~~~ !!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function bar() { var g = function baz(a: X, b: Y): T { x = y; ~ !!! Type 'U' is not assignable to type 'T'. return y; ~ !!! Type 'U' is not assignable to type 'T'. } } } var f3 = (x: T, y: U) => { ~~~~~~~~~~~ !!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function bar() { var g = (a: X, b: Y): T => { x = y; ~ !!! Type 'U' is not assignable to type 'T'. return y; ~ !!! Type 'U' is not assignable to type 'T'. } } } var f4 = (x: T, y: U) => { ~~~~~~~~~~~ !!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function bar() { var g = (a: X, b: Y): T => { x = y; ~ !!! Type 'U' is not assignable to type 'T'. return y; ~ !!! Type 'U' is not assignable to type 'T'. } } }