Commits

Doug Gregor committed 4708531e4dd
Rework the way we create child constraint systems based on making assumptions on type variable bindings. Instead of creating the child systems directly, we queue up the potential bindings so that we have better control over when the child systems are created. When child systems become unsolvable, we report that back to the parent. For child systems based on assumed type variable bindings, we can still attempt to bind that type variable with a slightly weaker binding (e.g., to a supertype of the original binding). This allows us to explore much more of the state space. Note that we stage the fallback to weaker bindings so that it only actually kicks in if none of the stronger bindings leads to a solution, so we can hold off on comparing solutions for a while longer. At present, there is only a single type -> supertype fallback for type variable bindings, which removes the label for a 1-tuple to turn it into a scalar. This allows us to type-check the inconceivably ridiculous code: func f0(x : Float) -> Float {} f0(1) Swift SVN r2744