Skip to content

Fix stack overflow in indexed access relation - #14874

Merged
Anders Hejlsberg (ahejlsberg) merged 3 commits into
masterfrom
fixIndexedAccessRelation
Mar 28, 2017
Merged

Anders Hejlsberg (ahejlsberg) merged 3 commits into
masterfrom
fixIndexedAccessRelation

Conversation

@ahejlsberg

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

@RyanCavanaugh Ryan Cavanaugh (RyanCavanaugh) Mar 27, 2017 •

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.

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
Copy Markdown
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
Anders Hejlsberg (ahejlsberg) deleted the fixIndexedAccessRelation branch March 28, 2017 04:20
@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jun 21, 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.

4 participants