TypeScript/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.errors.txt

88 lines
5.9 KiB
Plaintext
Raw Normal View History

tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(3,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-11-05 21:26:03 +01:00
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(5,12): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(8,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-11-05 21:26:03 +01:00
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(9,5): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(10,12): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(13,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-11-05 21:26:03 +01:00
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(14,5): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(15,12): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(18,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-11-05 21:26:03 +01:00
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(19,5): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(20,12): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(23,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-11-05 21:26:03 +01:00
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(24,5): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(25,12): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(28,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-11-05 21:26:03 +01:00
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(29,5): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(30,12): error TS2322: Type 'U' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts (18 errors) ====
// Type parameters are in scope in their own and other type parameter lists
function foo<T, U extends T>(x: T, y: U): T {
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-07-13 01:04:16 +02:00
x = y;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'U' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
return y;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'U' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
}
function foo2<U extends T, T>(x: T, y: U): T {
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-07-13 01:04:16 +02:00
x = y;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'U' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
return y;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'U' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
}
var f = function <T, U extends T>(x: T, y: U): T {
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-07-13 01:04:16 +02:00
x = y;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'U' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
return y;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'U' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
}
var f2 = function <U extends T, T>(x: T, y: U): T {
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-07-13 01:04:16 +02:00
x = y;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'U' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
return y;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'U' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
}
var f3 = <T, U extends T>(x: T, y: U): T => {
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-07-13 01:04:16 +02:00
x = y;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'U' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
return y;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'U' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
}
var f4 = <U extends T, T>(x: T, y: U): T => {
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-07-13 01:04:16 +02:00
x = y;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'U' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
return y;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'U' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
}