[ConstraintSystem] Repair and diagnose failures relared to throws mismatch

If the only difference between two functions is `throws` and it
is not a subtype relationship, let's repair the problem by dropping
`throws` attribute and letting solver continue to search for
a solution, which would later be diagnosed.
This commit is contained in:
Pavel Yaskevich
2019-08-12 09:37:03 -07:00
parent 290ec3c1cc
commit 15ae692da0
9 changed files with 89 additions and 31 deletions

View File

@@ -53,7 +53,7 @@ func process(_ line: UInt = #line) -> Int { return 0 }
func dangerous() throws {}
func test() {
process { // expected-error {{invalid conversion from throwing function of type '() throws -> ()' to non-throwing function type '() -> Void'}}
process { // expected-error {{invalid conversion from throwing function of type '() throws -> Void' to non-throwing function type '() -> Void'}}
try dangerous()
test()
}