Skip to content

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
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
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