Skip to content

Properly handle tagged primitives in control flow analysis #43538

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

Merged
merged 5 commits into from
Apr 7, 2021
Merged

Conversation

ahejlsberg
Copy link
Member

Fixes #43502.

Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

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

This looks OK, but what about something like T & {__tag: void} & string? Should the T's constraints still be contributing facts? As written they always do, which is... Maybe bad? If T is constrained to tags, I think the original issue recurs.

@ahejlsberg
Copy link
Member Author

but what about something like T & {__tag: void} & string? Should the T's constraints still be contributing facts?

Yeah, good point. I'll make sure that's handled too.

Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

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

A test with union/intersection constraints would be nice, but I think this looks good.

@ahejlsberg ahejlsberg merged commit d41943e into master Apr 7, 2021
@ahejlsberg ahejlsberg deleted the fix43502 branch April 7, 2021 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: Tagged types are incorrectly refined
4 participants