Skip to content

Make some code in checker neater#12862

Merged
1 commit merged into
masterfrom
neater_checker
Dec 14, 2016
Merged

Make some code in checker neater#12862
1 commit merged into
masterfrom
neater_checker

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Dec 12, 2016

No description provided.

Comment thread src/compiler/checker.ts

function getDeclarationOfAliasSymbol(symbol: Symbol): Declaration | undefined {
return forEach(symbol.declarations, d => isAliasSymbolDeclaration(d) ? d : undefined);
return find<Declaration>(symbol.declarations, isAliasSymbolDeclaration);
Copy link
Copy Markdown
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
Copy Markdown
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