Skip to content

Refactor narrow type by instance of #3064

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 5 commits into from
May 7, 2015
Merged

Conversation

mhegazy
Copy link
Contributor

@mhegazy mhegazy commented May 7, 2015

Refactor narrowTypeByInstanceof to be more uniform for its two branches (prototype and construct signature return types), also fixed an issue we ran into in real world code. Added a regression test for it.

else if (rightType.flags & TypeFlags.Anonymous) {
constructSignatures = getSignaturesOfType(rightType, SignatureKind.Construct);
}
if (constructSignatures && constructSignatures.length) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Put an extra newline here so it looks separate from the prior two conditions

@JsonFreeman
Copy link
Contributor

👍

mhegazy added a commit that referenced this pull request May 7, 2015
@mhegazy mhegazy merged commit b40849b into master May 7, 2015
@mhegazy mhegazy deleted the refactorNarrowTypeByInstanceOf branch May 7, 2015 18:39
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 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.

3 participants