Commits

Roman Levenstein committed 5bd460d7c1e
[simplify-cfg] Better handling of return type casts. The castReturnValue function, which is responsible for casting actual return types into expected return types, was failing on certain combinations of types. Specifically, it was failing if the actual return type was a tuple without labels and the expected return type was a tuple with labels, e.g in this case: (Int32, Int32) and (first: Int32, second: Int32). This is properly handled now: - If both types are tuples, the compiler would create a tuple of the required type by composing it from elements of the original tuple. - If both types are layout compatible (have exactly the same structural elements), then the compiler would insert proper casts. Fixes rdar://23026224 Swift SVN r32556