Skip to content

Commit d369700

Browse files
committed
Accept new baselines
1 parent bb14f53 commit d369700

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
circularInlineMappedGenericTupleTypeNoCrash.ts(11,12): error TS2589: Type instantiation is excessively deep and possibly infinite.
2+
3+
4+
==== circularInlineMappedGenericTupleTypeNoCrash.ts (1 errors) ====
5+
class Foo<Elements extends readonly unknown[]> {
6+
public readonly elements: { [P in keyof Elements]: { bar: Elements[P] } };
7+
8+
public constructor(
9+
...elements: { [P in keyof Elements]: { bar: Elements[P] } }
10+
) {
11+
this.elements = elements;
12+
}
13+
14+
public add(): Foo<[...Elements, "abc"]> {
15+
return new Foo<[...Elements, "abc"]>(...this.elements, { bar: "abc" });
16+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17+
!!! error TS2589: Type instantiation is excessively deep and possibly infinite.
18+
}
19+
}
20+

tests/baselines/reference/circularInlineMappedGenericTupleTypeNoCrash.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class Foo<Elements extends readonly unknown[]> {
3232
>this.elements : { [P in keyof Elements]: { bar: Elements[P]; }; }
3333
>this : this
3434
>elements : { [P in keyof Elements]: { bar: Elements[P]; }; }
35-
>{ bar: "abc" } : { bar: "abc"; }
36-
>bar : "abc"
35+
>{ bar: "abc" } : { bar: string; }
36+
>bar : string
3737
>"abc" : "abc"
3838
}
3939
}

0 commit comments

Comments
 (0)