-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Find all refs/rename for mapped type symbols via Record #20272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Duplicate of #11997 |
After reading that issue, I don't understand why this works when using mapped types and |
To re-iterate: // Renaming does work across mapped types
{
type T = { a: number, b: string };
type O = { [key in keyof T]: {} };
var t: T = { a: 1, b: "s" };
var o: O = { a: 3, b: 4 };
}
// Renaming does not work across mapped types
{
type T = { a: number, b: string };
type O = Record<keyof T, {}>;
var t: T = { a: 1, b: "s" };
var o: O = { a: 3, b: 4 };
}
// Renaming does not work across mapped types
{
type T = { a: number, b: string };
type MyRecord<T extends string, V> = { [key in T]: V }
type O = MyRecord<keyof T, {}>;
var t: T = { a: 1, b: "s" };
var o: O = { a: 3, b: 4 };
} |
@mhegazy Hey! Do you have any ideas why this issue appears to only occur when using |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
TypeScript Version: 2.6.1.
Code
Renaming
a
should rename both instances ofa
T.a
andO.a
, but it doesn't.If we replace
Record
with its underlying implementation, renaming does work:Related #12450
The text was updated successfully, but these errors were encountered: