mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user