Skip to content

Get resolved module exports in symbol chain and not raw exports#20661

Merged
weswigham merged 3 commits intomicrosoft:masterfrom
weswigham:export-star-alias
Dec 13, 2017
Merged

Get resolved module exports in symbol chain and not raw exports#20661
weswigham merged 3 commits intomicrosoft:masterfrom
weswigham:export-star-alias

Conversation

@weswigham
Copy link
Copy Markdown
Member

Fixes #20657

@weswigham weswigham requested review from a user, rbuckton and sandersn December 12, 2017 23:14
@robyoder
Copy link
Copy Markdown

That was fast! Thank you, @weswigham. ❤️

Comment thread src/compiler/checker.ts Outdated
// but only if the symbolFromSymbolTable can be qualified
const accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined;
const candidateTable = getExportsOfSymbol(resolvedImportedSymbol);
const accessibleSymbolsFromExports = candidateTable ? getAccessibleSymbolChainFromSymbolTable(candidateTable) : undefined;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: Good place to use && instead of ?:

//// [tests/cases/compiler/declarationEmitAliasExportStar.ts] ////

//// [thingA.ts]
export interface ThingA { }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I can reproduce the error without ThingA:
a.ts

export interface I { }

b.ts

export * from "./a";

c.ts

import * as b from "./b";
export const f = (_: b.I) => {};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yep. I included ThingA in my issue report only to illustrate the difference between #19852 and #20657. No need to include it in the test.

@weswigham weswigham merged commit e1278f0 into microsoft:master Dec 13, 2017
@weswigham weswigham deleted the export-star-alias branch December 13, 2017 22:01
@microsoft microsoft locked and limited conversation to collaborators Jun 21, 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.

2 participants