Skip to content

Renaming a namespace export's name does not update name in import specifiers #36836

Closed
@dsherret

Description

@dsherret

TypeScript Version: 3.9.0-dev20200215

Search Terms: Namespace export rename

Code

a.ts:

export class Test {
    name = 5;
}

b.ts:

export * as ns from "./a"; // <-- rename ns to nsTest

c.ts:

import { ns } from "./b";

const t = new ns.Test();

Expected behavior:

b.ts:

export * as nsTest from "./a";

c.ts (depends on setting "Rename Shorthand Properties" I think):

import { nsTest } from "./b";

const t = new nsTest.Test();

Actual behavior:

b.ts:

export * as nsTest from "./a";

c.ts:

import { ns } from "./b";

const t = new ns.Test();

So, c.ts does not have any of its identifiers renamed.

2020-02-17_11-19-06

Metadata

Metadata

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions