Skip to content
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

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

Merged
merged 3 commits into from
Dec 13, 2017

Conversation

weswigham
Copy link
Member

Fixes #20657

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

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

@@ -2216,7 +2216,8 @@ namespace ts {

// Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain
// 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

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

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) => {};

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