-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5897d7a
commit f8b3ea7
Showing
6 changed files
with
168 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
tests/baselines/reference/excessivelyLargeTupleSpread.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
tests/baselines/reference/recursiveConditionalCrash4.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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; | ||
|
65 changes: 65 additions & 0 deletions
65
tests/baselines/reference/recursiveConditionalCrash4.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
=== tests/cases/compiler/recursiveConditionalCrash4.ts === | ||
// Repros from #53783 | ||
|
||
type LengthDown< | ||
>LengthDown : Symbol(LengthDown, Decl(recursiveConditionalCrash4.ts, 0, 0)) | ||
|
||
Str extends string, | ||
>Str : Symbol(Str, Decl(recursiveConditionalCrash4.ts, 2, 16)) | ||
|
||
Length extends number | bigint, | ||
>Length : Symbol(Length, Decl(recursiveConditionalCrash4.ts, 3, 21)) | ||
|
||
It | ||
>It : Symbol(It, Decl(recursiveConditionalCrash4.ts, 4, 33)) | ||
|
||
> = It extends StrIter.Iterator | ||
>It : Symbol(It, Decl(recursiveConditionalCrash4.ts, 4, 33)) | ||
>StrIter : Symbol(StrIter) | ||
>Iterator : Symbol(StrIter.Iterator) | ||
|
||
? StrIter.CutAt<Str, It> extends `${infer $Rest}` | ||
>StrIter : Symbol(StrIter) | ||
>CutAt : Symbol(StrIter.CutAt) | ||
>Str : Symbol(Str, Decl(recursiveConditionalCrash4.ts, 2, 16)) | ||
>It : Symbol(It, Decl(recursiveConditionalCrash4.ts, 4, 33)) | ||
>$Rest : Symbol($Rest, Decl(recursiveConditionalCrash4.ts, 7, 43)) | ||
|
||
? LengthDown<$Rest, Add<Length, StrIter.Value<It>>, It> | ||
>LengthDown : Symbol(LengthDown, Decl(recursiveConditionalCrash4.ts, 0, 0)) | ||
>$Rest : Symbol($Rest, Decl(recursiveConditionalCrash4.ts, 7, 43)) | ||
>Add : Symbol(Add) | ||
>Length : Symbol(Length, Decl(recursiveConditionalCrash4.ts, 3, 21)) | ||
>StrIter : Symbol(StrIter) | ||
>Value : Symbol(StrIter.Value) | ||
>It : Symbol(It, Decl(recursiveConditionalCrash4.ts, 4, 33)) | ||
>It : Symbol(It, Decl(recursiveConditionalCrash4.ts, 4, 33)) | ||
|
||
: LengthDown<Str, Length, StrIter.Prev<It>> | ||
>LengthDown : Symbol(LengthDown, Decl(recursiveConditionalCrash4.ts, 0, 0)) | ||
>Str : Symbol(Str, Decl(recursiveConditionalCrash4.ts, 2, 16)) | ||
>Length : Symbol(Length, Decl(recursiveConditionalCrash4.ts, 3, 21)) | ||
>StrIter : Symbol(StrIter) | ||
>Prev : Symbol(StrIter.Prev) | ||
>It : Symbol(It, Decl(recursiveConditionalCrash4.ts, 4, 33)) | ||
|
||
: Length; | ||
>Length : Symbol(Length, Decl(recursiveConditionalCrash4.ts, 3, 21)) | ||
|
||
type Foo<T> = T extends unknown | ||
>Foo : Symbol(Foo, Decl(recursiveConditionalCrash4.ts, 10, 11)) | ||
>T : Symbol(T, Decl(recursiveConditionalCrash4.ts, 12, 9)) | ||
>T : Symbol(T, Decl(recursiveConditionalCrash4.ts, 12, 9)) | ||
|
||
? unknown extends `${infer $Rest}` | ||
>$Rest : Symbol($Rest, Decl(recursiveConditionalCrash4.ts, 13, 28)) | ||
|
||
? Foo<T> | ||
>Foo : Symbol(Foo, Decl(recursiveConditionalCrash4.ts, 10, 11)) | ||
>T : Symbol(T, Decl(recursiveConditionalCrash4.ts, 12, 9)) | ||
|
||
: Foo<unknown> | ||
>Foo : Symbol(Foo, Decl(recursiveConditionalCrash4.ts, 10, 11)) | ||
|
||
: unknown; | ||
|
31 changes: 31 additions & 0 deletions
31
tests/baselines/reference/recursiveConditionalCrash4.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
=== tests/cases/compiler/recursiveConditionalCrash4.ts === | ||
// Repros from #53783 | ||
|
||
type LengthDown< | ||
>LengthDown : LengthDown<Str, Length, It> | ||
|
||
Str extends string, | ||
Length extends number | bigint, | ||
It | ||
> = It extends StrIter.Iterator | ||
>StrIter : any | ||
|
||
? StrIter.CutAt<Str, It> extends `${infer $Rest}` | ||
>StrIter : any | ||
|
||
? LengthDown<$Rest, Add<Length, StrIter.Value<It>>, It> | ||
>StrIter : any | ||
|
||
: LengthDown<Str, Length, StrIter.Prev<It>> | ||
>StrIter : any | ||
|
||
: Length; | ||
|
||
type Foo<T> = T extends unknown | ||
>Foo : Foo<T> | ||
|
||
? unknown extends `${infer $Rest}` | ||
? Foo<T> | ||
: Foo<unknown> | ||
: unknown; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// @strict: true | ||
// @noEmit: true | ||
|
||
// Repros from #53783 | ||
|
||
type LengthDown< | ||
Str extends string, | ||
Length extends number | bigint, | ||
It | ||
> = It extends StrIter.Iterator | ||
? StrIter.CutAt<Str, It> extends `${infer $Rest}` | ||
? LengthDown<$Rest, Add<Length, StrIter.Value<It>>, It> | ||
: LengthDown<Str, Length, StrIter.Prev<It>> | ||
: Length; | ||
|
||
type Foo<T> = T extends unknown | ||
? unknown extends `${infer $Rest}` | ||
? Foo<T> | ||
: Foo<unknown> | ||
: unknown; |