Skip to content

When getting contextual type with property name for element access, do it without using index signature since we are anyways going to get it later by index signature if nothing matches. #27996

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

Closed
wants to merge 1 commit into from

Conversation

sheetalkamat
Copy link
Member

Fixes #27975

…o it without using index signature since we are anyways going to get it later by index signature if nothing matches.

Fixes #27975
@@ -16754,8 +16754,10 @@ namespace ts {
return restType;
}
}
return isNumericLiteralName(name) && getIndexTypeOfContextualType(t, IndexKind.Number) ||
getIndexTypeOfContextualType(t, IndexKind.String);
if (!ignoreIndexSignatureWhenNoProp) {
Copy link
Member

Choose a reason for hiding this comment

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

Rather than this flag, shouldn't the getIteratedTypeOrElementType fallback just be duplicated into this as well?

@sheetalkamat
Copy link
Member Author

Closing this in favor of #28005

@sheetalkamat sheetalkamat deleted the contextualSignature2 branch October 19, 2018 23:11
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.

2 participants