14 lines
No EOL
450 B
Text
14 lines
No EOL
450 B
Text
==== tests/cases/compiler/assignmentStricterConstraints.ts (2 errors) ====
|
|
var f = function <T, S extends T>(x: T, y: S): void {
|
|
~~~~~~~~~~~
|
|
!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
x = y
|
|
~
|
|
!!! Type 'S' is not assignable to type 'T'.
|
|
}
|
|
|
|
var g = function <T, S>(x: T, y: S): void { }
|
|
|
|
g = f
|
|
g(1, "")
|
|
|