14 lines
479 B
Text
14 lines
479 B
Text
|
==== tests/cases/compiler/recursiveIdenticalAssignment.ts (1 errors) ====
|
||
|
interface A<T> {
|
||
|
x: A<T>
|
||
|
}
|
||
|
|
||
|
interface B<T extends B<B<T>>> { // error, constraint referencing itself
|
||
|
~~~~~~~~~~~~~~~~~
|
||
|
!!! 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>>
|
||
|
|