Skip to content

Fix stack overflow in indexed access relation #14874

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Mar 28, 2017

Conversation

ahejlsberg
Copy link
Member

Fixes #14723.

Type 'T' is not assignable to type 'U'.
Type 'T[keyof T]' is not assignable to type 'U[string]'.
Type 'T[string]' is not assignable to type 'U[string]'.
Type 'T' is not assignable to type 'U'.
Copy link
Member

@RyanCavanaugh RyanCavanaugh Mar 27, 2017

Choose a reason for hiding this comment

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

Is there any way to not do this? Going around in circles here: 'T' is not assignable to type 'U'. because 'T' is not assignable to type 'U'. because 'T' is not assignable to type 'U'.

Copy link
Member Author

Choose a reason for hiding this comment

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

Our error elaboration scheme works well when we drill down along a single path, but sometimes that isn't the case. In this particular example we're drilling down three paths, each of which end with T not being assignable to U. We could attempt to eliminate paths that have already been elaborated from the error reporting (perhaps by simply dropping elaborations that are already present in the diagnostic chain), but that's really an issue that is orthogonal to this PR.

@ahejlsberg ahejlsberg merged commit 1ae5bef into master Mar 28, 2017
@ahejlsberg ahejlsberg deleted the fixIndexedAccessRelation branch March 28, 2017 04:20
@microsoft microsoft locked and limited conversation to collaborators Jun 21, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants