Skip to content

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

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

Closed
dsherret opened this issue Feb 17, 2020 · 2 comments
Closed
Assignees
Labels
Bug A bug in TypeScript

Comments

@dsherret
Copy link
Contributor

dsherret commented Feb 17, 2020

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

@dsherret
Copy link
Contributor Author

dsherret commented Feb 17, 2020

Doesn't seem to update in this scenario either:

import("./b").then(test => {
    new test.ns.Test();
});

@jessetrinity
Copy link
Contributor

Fixed in #39533

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants