Skip to content
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

Go back to old narrowing algorithm but don't narrow in cases like #26130 #26425

Merged
merged 1 commit into from
Aug 20, 2018

Conversation

mattmccutchen
Copy link
Contributor

@mattmccutchen mattmccutchen commented Aug 13, 2018

Fixes #26405.

…microsoft#26130 by

skipping narrowing if the old algorithm produces a type to which the
assigned type is not assignable.

This also means we'll no longer narrow for erroneous assignments where
the assigned type is not assignable to the declared type.  This is the
reason for the numericLiteralTypes3 baseline change.

Fixes microsoft#26405.
@mattmccutchen mattmccutchen changed the title Have getAssignmentReducedType use a new relation that checks for weak types. Go back to old narrowing algorithm but don't narrow in cases like #26130 Aug 18, 2018
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.

@RyanCavanaugh I think we should go with this - seems like a pretty sane update of the original code.

@ahejlsberg ahejlsberg merged commit 103f894 into microsoft:master Aug 20, 2018
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.

4 participants