Skip to content

Check all intersection constituents against index signatures in target #34546

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 4 commits into from

Conversation

ahejlsberg
Copy link
Member

With this PR we check that all constituents of an intersection source type relate to index signatures in the target type. For example:

declare let s: { a: string } & { b: number };
declare let t: { [key: string]: string };
t = s;  // Error

Previously, no error was reported above.

Fixes #32484.

@ahejlsberg
Copy link
Member Author

@typescript-bot run dt
@typescript-bot test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 17, 2019

Heya @ahejlsberg, I've started to run the extended test suite on this PR at 63ed5b0. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 17, 2019

Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at 63ed5b0. You can monitor the build here. It should now contribute to this PR's status checks.

@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.8.0 milestone Oct 21, 2019
@ahejlsberg
Copy link
Member Author

Closing in favor of #35143.

@ahejlsberg ahejlsberg closed this Nov 16, 2019
@ahejlsberg ahejlsberg deleted the fix32484 branch November 16, 2019 16:37
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.

When creating a mapped type of an indexed type it extends too liberal
3 participants