Commits

Doug Gregor committed 91ffa957b96
Add very basic support for selecting the best solution when the constraint solver produces multiple solutions. The criteria for "best" are fairly simple: we compare the bindings for each type variable bound in both solutions: - If the binding in the first solution is a subtype of the binding in the second solution, but not vice-versa, the first solution is at least as good as the second - If the type variable has a literal constraint on it, and the bound type in the first solution matches the default literal type for that literal kind, the first solution is as good as the second. From there, we follow the obvious rules for picking a winner: if some of the type variables in the first solution are as good as the same type variables in the second solution, but none of the type variables are worse, then the first solution is better. We can now type-check "1 + 2.0". Take *that*, TypeCheckCoercion.cpp. Swift SVN r2894