Commit graph

6 commits

Author SHA1 Message Date
Matt McCutchen cc1c2ab6b2 Go back to the old narrowing algorithm (pre #26143) and avoid #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 #26405.
2018-08-17 21:35:03 -04:00
Matt McCutchen d45e422b46 Have getAssignmentReducedType use the comparable relation instead of
typeMaybeAssignableTo.

typeMaybeAssignableTo decomposed unions at the top level of the assigned
type but didn't properly handle other unions that arose during
assignability checking, e.g., in the constraint of a generic lookup
type.

Fixes #26130.
2018-08-01 23:26:17 -04:00
Anders Hejlsberg b14b24a96e Update tests 2016-09-21 16:03:51 -07:00
Ivo Gabe de Wolff 4f936c468b Add control flow tests 2016-03-25 21:29:58 +01:00
Vladimir Matveev bc02341e99 addressed PR feedback, updated tests to suppress reachability errors where they are not needed 2015-10-13 10:58:55 -07:00
Mohamed Hegazy 214df64e28 Add snapshot of compiler sources 2014-07-12 17:30:19 -07:00