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(
3667
3667
TMF_ApplyingFix, locator);
3668
3668
3669
3669
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
+
3670
3676
conversionsOrFixes.push_back (
3671
3677
TreatRValueAsLValue::create (*this , getConstraintLocator (locator)));
3672
3678
return true ;
Original file line number Diff line number Diff line change @@ -1084,3 +1084,16 @@ var emptyBodyMismatch: () -> Int {
1084
1084
return
1085
1085
}
1086
1086
}
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