TypeScript/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.errors.txt
2014-11-05 12:26:03 -08:00

113 lines
7 KiB
Plaintext

tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(4,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(7,13): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(8,20): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(13,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(16,13): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(17,20): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(22,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(25,13): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(26,20): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(31,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(34,13): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(35,20): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(40,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(43,13): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(44,20): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(49,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(52,13): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(53,20): error TS2322: Type 'U' is not assignable to type 'T'.
==== 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<T, U extends T>(x: T, y: U) {
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
function bar<V extends T, W extends U>() {
function baz<X extends W, Y extends V>(a: X, b: Y): T {
x = y;
~
!!! error TS2322: Type 'U' is not assignable to type 'T'.
return y;
~
!!! error TS2322: Type 'U' is not assignable to type 'T'.
}
}
}
function foo2<U extends T, T>(x: T, y: U) {
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
function bar<V extends T, W extends U>() {
function baz<X extends W, Y extends V>(a: X, b: Y): T {
x = y;
~
!!! error TS2322: Type 'U' is not assignable to type 'T'.
return y;
~
!!! error TS2322: Type 'U' is not assignable to type 'T'.
}
}
}
var f = function <T, U extends T>(x: T, y: U) {
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
function bar<V extends T, W extends U>() {
var g = function <X extends W, Y extends V>(a: X, b: Y): T {
x = y;
~
!!! error TS2322: Type 'U' is not assignable to type 'T'.
return y;
~
!!! error TS2322: Type 'U' is not assignable to type 'T'.
}
}
}
var f2 = function <U extends T, T>(x: T, y: U) {
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
function bar<V extends T, W extends U>() {
var g = function baz<X extends W, Y extends V>(a: X, b: Y): T {
x = y;
~
!!! error TS2322: Type 'U' is not assignable to type 'T'.
return y;
~
!!! error TS2322: Type 'U' is not assignable to type 'T'.
}
}
}
var f3 = <T, U extends T>(x: T, y: U) => {
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
function bar<V extends T, W extends U>() {
var g = <X extends W, Y extends V>(a: X, b: Y): T => {
x = y;
~
!!! error TS2322: Type 'U' is not assignable to type 'T'.
return y;
~
!!! error TS2322: Type 'U' is not assignable to type 'T'.
}
}
}
var f4 = <U extends T, T>(x: T, y: U) => {
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
function bar<V extends T, W extends U>() {
var g = <X extends W, Y extends V>(a: X, b: Y): T => {
x = y;
~
!!! error TS2322: Type 'U' is not assignable to type 'T'.
return y;
~
!!! error TS2322: Type 'U' is not assignable to type 'T'.
}
}
}