[Diagnostics] Treat type requirement failures associated with Self = Any as unrelated

This helps us to filter out cases like operator overloads where
`Self` type comes from e.g. default for collection element -
`[1, "hello"].map { $0 + 1 }`. Main problem here is that
collection type couldn't be determined without unification to
`Any` and `+` failing for all numeric overloads is just a consequence.
This commit is contained in:
Pavel Yaskevich
2019-08-29 15:27:29 -07:00
parent facd27fc45
commit ecf8146938
2 changed files with 19 additions and 3 deletions

View File

@@ -182,8 +182,7 @@ func r22162441(_ lines: [String]) {
func testMap() {
let a = 42
[1,a].map { $0 + 1.0 } // expected-error {{binary operator '+' cannot be applied to operands of type 'Any' and 'Double'}}
// expected-note @-1 {{expected an argument list of type '(Double, Double)'}}
[1,a].map { $0 + 1.0 } // expected-error {{cannot convert value of type 'Int' to expected element type 'Double'}}
}
// <rdar://problem/22414757> "UnresolvedDot" "in wrong phase" assertion from verifier