File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -3047,11 +3047,12 @@ bool ConstraintSystem::repairFailures(
3047
3047
// default values, let's see whether error is related to missing
3048
3048
// explicit call.
3049
3049
if (fnType->getNumParams () > 0 ) {
3050
- auto anchor = simplifyLocatorToAnchor (getConstraintLocator (locator));
3051
- if (!anchor.is <Expr *>())
3050
+ auto *loc = getConstraintLocator (locator);
3051
+ auto *anchor = getAsExpr (simplifyLocatorToAnchor (loc));
3052
+ if (!anchor)
3052
3053
return false ;
3053
3054
3054
- auto overload = findSelectedOverloadFor (getAsExpr ( anchor) );
3055
+ auto overload = findSelectedOverloadFor (anchor);
3055
3056
if (!(overload && overload->choice .isDecl ()))
3056
3057
return false ;
3057
3058
Original file line number Diff line number Diff line change
1
+ // RUN: %target-typecheck-verify-swift
2
+
3
+ protocol P { }
4
+ typealias T = ( P ) -> Void
5
+ let x : T ! = [ 1 , 2 , 3 ] . reversed ( ) . reduce ( )
6
+ // expected-error@-1 {{no exact matches in call to instance method 'reduce'}}
7
+ // expected-note@-2 2{{candidate has partially matching parameter list}}
You can’t perform that action at this time.
0 commit comments