Skip to content

getPropertiesOfUnionOrIntersectionType: handle types with index signature#31979

Merged
sandersn merged 4 commits intomicrosoft:masterfrom
ajafff:gerpropertiesofuniontype-indexsignature
Mar 13, 2020
Merged

getPropertiesOfUnionOrIntersectionType: handle types with index signature#31979
sandersn merged 4 commits intomicrosoft:masterfrom
ajafff:gerpropertiesofuniontype-indexsignature

Conversation

@ajafff
Copy link
Copy Markdown
Contributor

@ajafff ajafff commented Jun 19, 2019

Fixes: #31565

Copy link
Copy Markdown
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.

👍 I'll merge this after the typo is fixed.

Comment thread src/compiler/checker.ts Outdated
// The properties of a union type are those that are present in all constituent types, so
// we only need to check the properties of the first type
if (type.flags & TypeFlags.Union) {
// we only need to check the properties of the first type wihtout index signature
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.

Suggested change
// we only need to check the properties of the first type wihtout index signature
// we only need to check the properties of the first type without index signature

@sandersn sandersn merged commit 8b6bd41 into microsoft:master Mar 13, 2020
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

API: inconsistent Type#getProperties involving index signature and union type order

4 participants