Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support "equivalent to" for values (#252)
Fixes #167 Weirdly the `Resolve` helper only resolves types at the top level, not in functions: ```ts interface Point { x: number; y: number; } type Resolve<Raw> = Raw extends Function ? Raw : { [K in keyof Raw]: Raw[K] }; function foo(pt: Point) { let k: keyof Point; for (k in pt) { // ^? let k: keyof Point type SynthK = Resolve<keyof Point>; // ^? type SynthK = keyof Point } } type SynthT2 = Resolve<keyof Point>; // ^? type SynthT2 = "x" | "y"`); ``` This might be microsoft/TypeScript#49852
- Loading branch information
Showing
4 changed files
with
197 additions
and
12 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
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
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
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