mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-26 10:43:51 -05:00
Fix mapped type instantiation circularity (#46586)
* Don't obtain constraint if doing so would cause circularity * Add regression test * Address CR feedback
This commit is contained in:
@@ -53,4 +53,13 @@ declare function stringifyArray<T extends readonly any[]>(arr: T): { -readonly [
|
||||
let abc: any[] = stringifyArray(void 0 as any);
|
||||
|
||||
declare function stringifyPair<T extends readonly [any, any]>(arr: T): { -readonly [K in keyof T]: string };
|
||||
let def: [any, any] = stringifyPair(void 0 as any);
|
||||
let def: [any, any] = stringifyPair(void 0 as any);
|
||||
|
||||
// Repro from #46582
|
||||
|
||||
type Evolvable<E extends Evolver> = {
|
||||
[P in keyof E]: never;
|
||||
};
|
||||
type Evolver<T extends Evolvable<any> = any> = {
|
||||
[key in keyof Partial<T>]: never;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user