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

18 lines
775 B
Plaintext
Raw Normal View History

tests/cases/compiler/assignmentStricterConstraints.ts(1,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/compiler/assignmentStricterConstraints.ts(2,5): error TS2322: Type 'S' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/assignmentStricterConstraints.ts (2 errors) ====
var f = function <T, S extends T>(x: T, y: S): void {
~~~~~~~~~~~
!!! 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 'S' is not assignable to type 'T'.
2014-07-13 01:04:16 +02:00
}
var g = function <T, S>(x: T, y: S): void { }
g = f
g(1, "")