-
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
bb14f53
commit d369700
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
tests/baselines/reference/circularInlineMappedGenericTupleTypeNoCrash.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,20 @@ | ||
circularInlineMappedGenericTupleTypeNoCrash.ts(11,12): error TS2589: Type instantiation is excessively deep and possibly infinite. | ||
|
||
|
||
==== circularInlineMappedGenericTupleTypeNoCrash.ts (1 errors) ==== | ||
class Foo<Elements extends readonly unknown[]> { | ||
public readonly elements: { [P in keyof Elements]: { bar: Elements[P] } }; | ||
|
||
public constructor( | ||
...elements: { [P in keyof Elements]: { bar: Elements[P] } } | ||
) { | ||
this.elements = elements; | ||
} | ||
|
||
public add(): Foo<[...Elements, "abc"]> { | ||
return new Foo<[...Elements, "abc"]>(...this.elements, { bar: "abc" }); | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2589: Type instantiation is excessively deep and possibly infinite. | ||
} | ||
} | ||
|
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