Skip to content

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

Merged
weswigham merged 1 commit into
microsoft:masterfrom
weswigham:fix-aliased-locals-and-declarations
May 31, 2018
Merged

For type emit, walk non-parent containers when those containers have aliases leading to the target#24507
weswigham merged 1 commit into
microsoft:masterfrom
weswigham:fix-aliased-locals-and-declarations

Conversation

@weswigham

Copy link
Copy Markdown
Member

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

Fixes this issue reported in this comment.

@weswigham weswigham requested review from mhegazy and sandersn May 30, 2018 23:22

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
Copy Markdown
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?

@weswigham weswigham May 30, 2018

Copy link
Copy Markdown
Member Author

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

mhegazy commented May 31, 2018

Copy link
Copy Markdown
Contributor

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