Skip to content

For type emit, walk non-parent containers when those containers have aliases leading to the target #24507

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

Merged

Conversation

weswigham
Copy link
Member

This way aliases can expose paths to local types in getAccessibleSymbolChain.

Fixes this issue reported in this comment.

@weswigham weswigham requested review from sandersn and mhegazy May 30, 2018 23:22
@@ -66,9 +66,9 @@ export const x: import("./foo") = { x: 0, y: 0 };
>0 : 0

export let y: import("./foo2").Bar.I = { a: "", b: 0 };
>y : Bar.I
>y : import("tests/cases/conformance/types/import/foo2").Bar.I
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be import("./foo") instead of this whole path?

Copy link
Member Author

@weswigham weswigham May 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in the types baselines - they have no enclosing declaration (or rather, they have no emit resolver with which to resolve the path to a local one because it's not really emit) specified for their type writer, so they get the whole path.

@mhegazy
Copy link
Contributor

mhegazy commented May 31, 2018

Please port to release-2.9 as well.

@weswigham weswigham merged commit 576a733 into microsoft:master May 31, 2018
@weswigham weswigham deleted the fix-aliased-locals-and-declarations branch May 31, 2018 00:53
weswigham added a commit to weswigham/TypeScript that referenced this pull request May 31, 2018
weswigham added a commit that referenced this pull request May 31, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants