Skip to content

Make some code in checker neater #12862

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
1 commit merged into from
Dec 14, 2016
Merged

Make some code in checker neater #12862

1 commit merged into from
Dec 14, 2016

Conversation

ghost
Copy link

@ghost ghost commented Dec 12, 2016

No description provided.

@@ -1100,7 +1098,7 @@ namespace ts {
}

function getDeclarationOfAliasSymbol(symbol: Symbol): Declaration | undefined {
return forEach(symbol.declarations, d => isAliasSymbolDeclaration(d) ? d : undefined);
return find<Declaration>(symbol.declarations, isAliasSymbolDeclaration);
Copy link
Author

Choose a reason for hiding this comment

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

symbol.declarations is Declaration[] but isAliasSymbolDeclaration takes a Node. It's odd that this infers Node as the type. Should this be an issue?

Copy link
Member

Choose a reason for hiding this comment

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

Probably yes -- I would think that symbol.declarations would be the one providing the type for inference. It's worth investigating even if it ends up being by design.

@ghost ghost force-pushed the neater_checker branch from a9decf6 to 891159c Compare December 13, 2016 15:22
@ghost ghost merged commit 757af49 into master Dec 14, 2016
@ghost ghost deleted the neater_checker branch December 14, 2016 15:48
@mhegazy mhegazy mentioned this pull request Dec 14, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
This pull request was closed.
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