Skip to content

Find all refs/rename for mapped type symbols via Record #20272

Closed
@OliverJAsh

Description

@OliverJAsh

TypeScript Version: 2.6.1.

Code

Renaming a should rename both instances of a T.a and O.a, but it doesn't.

{
  type T = { a: number, b: string };
  type O = Record<keyof T, {}>;
  var t: T = { a: 1, b: "s" };
  var o: O = { a: 3 };
}

If we replace Record with its underlying implementation, renaming does work:

{
  type T = { a: number, b: string };
  type O = { [key in keyof T]: {} };
  var t: T = { a: 1, b: "s" };
  var o: O = { a: 3 };
}

Related #12450

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions