Commit Graph

255 Commits

Author SHA1 Message Date
Doug Gregor
cf146ecaac Use disjunctions for "deep" equality match vs. user-defined conversions.
This should fix <rdar://problem/13140447> completely.


Swift SVN r9388
2013-10-15 23:36:40 +00:00
Doug Gregor
f57e20edd1 Use disjunctions for subclass-to-superclass vs. user-defined conversions.
This fixes the superclass conversion issue in <rdar://problem/13140447>.


Swift SVN r9337
2013-10-14 23:42:42 +00:00
Doug Gregor
8a896ef59a Use disjunction conversions to handle T -> U? conversion ambiguity.
The constraint solver was eagerly applying the T -> U? conversion
rule, which only succeeds when T is convertible to U. Thus, we would
reject valid code where T has a user-defined conversion to
U?. Instead, introduce a disjunction conversion to try either T -> U?
by converting T to U or via a user-defined conversion. 

Most of this is infrastructure for the introduction of constraint
restrictions, which specify that a particular constraint (say, a
conversion constraint) should only try a single direct path:
scalar-to-tuple, value-to-optional, user-defined, etc. Each term in the
disjunction created for the T -> U? case is restricted to a particular
conversion rule, so that checking it does not create another
disjunction.

Keep track of the constraint restrictions we used within a given
solution, so that we can replay those steps during the application
phase. There is a bunch of inactive code here at the moment, which
will become useful as we start creating disjunctions for other
ambiguous conversions.



Swift SVN r9318
2013-10-14 18:08:12 +00:00
Doug Gregor
16901477c2 Introduce an overload-binding constraint.
Overload bindings constraints bind a given type to a specific overload
choice. This is a step toward moving overload sets into normal
disjunction constraints.

Part of the work here is to eliminate the constraint system's
dependence on OverloadSet, which will be going away in favor of a
disjunction constraint.


Swift SVN r9209
2013-10-11 18:27:51 +00:00
Doug Gregor
2d215d68d3 Split Constraint and ConstraintLocator into their own headers.
No functionality change.


Swift SVN r9204
2013-10-11 17:24:46 +00:00