17 lines
No EOL
674 B
Text
17 lines
No EOL
674 B
Text
tests/cases/compiler/recursiveIdenticalAssignment.ts(5,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
|
|
|
|
==== tests/cases/compiler/recursiveIdenticalAssignment.ts (1 errors) ====
|
|
interface A<T> {
|
|
x: A<T>
|
|
}
|
|
|
|
interface B<T extends B<B<T>>> { // error, constraint referencing itself
|
|
~~~~~~~~~~~~~~~~~
|
|
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
x: B<T>
|
|
}
|
|
|
|
var a: A<A<any>>
|
|
var b: B<B<any>> = a // Error, any does not satisfy constraint B<B<T>>
|
|
|