Skip to content

Commit

Permalink
Accept new baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Jan 11, 2024
1 parent bb14f53 commit d369700
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
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.
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class Foo<Elements extends readonly unknown[]> {
>this.elements : { [P in keyof Elements]: { bar: Elements[P]; }; }
>this : this
>elements : { [P in keyof Elements]: { bar: Elements[P]; }; }
>{ bar: "abc" } : { bar: "abc"; }
>bar : "abc"
>{ bar: "abc" } : { bar: string; }
>bar : string
>"abc" : "abc"
}
}
Expand Down

0 comments on commit d369700

Please sign in to comment.