18 lines
775 B
Plaintext
18 lines
775 B
Plaintext
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.
|
|
tests/cases/compiler/assignmentStricterConstraints.ts(2,5): error TS2322: Type 'S' is not assignable to type 'T'.
|
|
|
|
|
|
==== 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.
|
|
x = y
|
|
~
|
|
!!! error TS2322: Type 'S' is not assignable to type 'T'.
|
|
}
|
|
|
|
var g = function <T, S>(x: T, y: S): void { }
|
|
|
|
g = f
|
|
g(1, "")
|
|
|