File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -406,6 +406,12 @@ class ApplyClassifier {
406
406
SmallVector<Expr*, 4 > args;
407
407
auto fnRef = AbstractFunction::decomposeApply (E, args);
408
408
409
+ // If any of the arguments didn't type check, fail.
410
+ for (auto arg : args) {
411
+ if (!arg->getType () || arg->getType ()->is <ErrorType>())
412
+ return Classification::forInvalidCode ();
413
+ }
414
+
409
415
// If we're applying more arguments than the natural argument
410
416
// count, then this is a call to the opaque value returned from
411
417
// the function.
Original file line number Diff line number Diff line change @@ -345,3 +345,11 @@ class C5 {
345
345
_ = x == x
346
346
}
347
347
}
348
+
349
+ class C6 {
350
+ static func == ( lhs: C6 , rhs: C6 ) -> Bool { return false }
351
+
352
+ func test1( x: C6 ) {
353
+ if x == x && x = x { } // expected-error{{cannot assign to value: '&&' returns immutable value}}
354
+ }
355
+ }
You can’t perform that action at this time.
0 commit comments