Skip to content

Avoid circularly resolving names when looking up type members using resolveName #26924

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
merged 2 commits into from
Sep 13, 2018

Conversation

weswigham
Copy link
Member

getMembersOfType causes computed late bound names to be evaluated and bound, which shouldn't happen during name resolution, as it is used.... during computed name and base type resolution (which must finish before late bound names are actually bindable).

Fixes #23828

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

Seems fine given my understand of normal name resolution, although @rbuckton should sign off too, because my understanding of latebound names is shaky.

@@ -1312,7 +1312,7 @@ namespace ts {
case SyntaxKind.ClassDeclaration:
case SyntaxKind.ClassExpression:
case SyntaxKind.InterfaceDeclaration:
if (result = lookup(getMembersOfSymbol(getSymbolOfNode(location as ClassLikeDeclaration | InterfaceDeclaration)), name, meaning & SymbolFlags.Type)) {
if (result = lookup(getSymbolOfNode(location as ClassLikeDeclaration | InterfaceDeclaration).members || emptySymbols, name, meaning & SymbolFlags.Type)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should document why we shouldn't resolve the members of the symbol here.

@weswigham weswigham merged commit d3463ce into microsoft:master Sep 13, 2018
@weswigham weswigham deleted the ambient-reference-checks branch September 13, 2018 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants