File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -3667,6 +3667,12 @@ bool ConstraintSystem::repairFailures(
36673667 TMF_ApplyingFix, locator);
36683668
36693669 if (result.isSuccess ()) {
3670+ // If left side is a hole, let's not record a fix since hole can
3671+ // assume any type and already represents a problem elsewhere in
3672+ // the expression.
3673+ if (lhs->isPlaceholder ())
3674+ return true ;
3675+
36703676 conversionsOrFixes.push_back (
36713677 TreatRValueAsLValue::create (*this , getConstraintLocator (locator)));
36723678 return true ;
Original file line number Diff line number Diff line change @@ -1084,3 +1084,16 @@ var emptyBodyMismatch: () -> Int {
10841084 return
10851085 }
10861086}
1087+
1088+ // rdar://76250381 - crash when passing an argument to a closure that takes no arguments
1089+ struct R_76250381 < Result, Failure: Error > {
1090+ func test( operation: @escaping ( ) -> Result ) -> Bool {
1091+ return try self . crash { group in // expected-error {{contextual closure type '() -> Result' expects 0 arguments, but 1 was used in closure body}}
1092+ operation ( & group) // expected-error {{argument passed to call that takes no arguments}}
1093+ }
1094+ }
1095+
1096+ func crash( _: @escaping ( ) -> Result ) -> Bool {
1097+ return false
1098+ }
1099+ }
You can’t perform that action at this time.
0 commit comments