1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
tests/cases/compiler/recursiveConditionalCrash4.ts(7,16): error TS2503: Cannot find namespace 'StrIter'.
tests/cases/compiler/recursiveConditionalCrash4.ts(8,5): error TS2503: Cannot find namespace 'StrIter'.
tests/cases/compiler/recursiveConditionalCrash4.ts(9,25): error TS2304: Cannot find name 'Add'.
tests/cases/compiler/recursiveConditionalCrash4.ts(9,37): error TS2503: Cannot find namespace 'StrIter'.
tests/cases/compiler/recursiveConditionalCrash4.ts(10,7): error TS2589: Type instantiation is excessively deep and possibly infinite.
tests/cases/compiler/recursiveConditionalCrash4.ts(10,31): error TS2503: Cannot find namespace 'StrIter'.
tests/cases/compiler/recursiveConditionalCrash4.ts(16,7): error TS2589: Type instantiation is excessively deep and possibly infinite.
==== tests/cases/compiler/recursiveConditionalCrash4.ts (7 errors) ====
// Repros from #53783
type LengthDown<
Str extends string,
Length extends number | bigint,
It
> = It extends StrIter.Iterator
~~~~~~~
!!! error TS2503: Cannot find namespace 'StrIter'.
? StrIter.CutAt<Str, It> extends `${infer $Rest}`
~~~~~~~
!!! error TS2503: Cannot find namespace 'StrIter'.
? LengthDown<$Rest, Add<Length, StrIter.Value<It>>, It>
~~~
!!! error TS2304: Cannot find name 'Add'.
~~~~~~~
!!! error TS2503: Cannot find namespace 'StrIter'.
: LengthDown<Str, Length, StrIter.Prev<It>>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2589: Type instantiation is excessively deep and possibly infinite.
~~~~~~~
!!! error TS2503: Cannot find namespace 'StrIter'.
: Length;
type Foo<T> = T extends unknown
? unknown extends `${infer $Rest}`
? Foo<T>
: Foo<unknown>
~~~~~~~~~~~~
!!! error TS2589: Type instantiation is excessively deep and possibly infinite.
: unknown;
|