File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ void constraints::simplifyLocator(Expr *&anchor,
147
147
148
148
while (!path.empty ()) {
149
149
switch (path[0 ].getKind ()) {
150
- case ConstraintLocator::ApplyArgument:
150
+ case ConstraintLocator::ApplyArgument: {
151
151
// Extract application argument.
152
152
if (auto applyExpr = dyn_cast<ApplyExpr>(anchor)) {
153
153
// The target anchor is the function being called.
@@ -167,7 +167,20 @@ void constraints::simplifyLocator(Expr *&anchor,
167
167
path = path.slice (1 );
168
168
continue ;
169
169
}
170
+
171
+ if (auto *UME = dyn_cast<UnresolvedMemberExpr>(anchor)) {
172
+ // The target anchor is the method being called,
173
+ // no additional information could be retrieved
174
+ // about this call.
175
+ targetAnchor = nullptr ;
176
+ targetPath.clear ();
177
+
178
+ anchor = UME->getArgument ();
179
+ path = path.slice (1 );
180
+ continue ;
181
+ }
170
182
break ;
183
+ }
171
184
172
185
case ConstraintLocator::ApplyFunction:
173
186
// Extract application function.
@@ -317,7 +330,7 @@ void constraints::simplifyLocator(Expr *&anchor,
317
330
// This was just for identifying purposes, strip it off.
318
331
path = path.slice (1 );
319
332
continue ;
320
-
333
+
321
334
default :
322
335
// FIXME: Lots of other cases to handle.
323
336
break ;
Original file line number Diff line number Diff line change @@ -447,7 +447,7 @@ let _: Color = .overload(1) // expected-error {{ambiguous reference to member '
447
447
let _: Color = . frob( 1.0 , & i) // expected-error {{missing argument label 'b:' in call}}
448
448
let _: Color = . frob( 1.0 , b: & i) // expected-error {{cannot convert value of type 'Double' to expected argument type 'Int'}}
449
449
let _: Color = . frob( 1 , i) // expected-error {{missing argument label 'b:' in call}}
450
- let _: Color = . frob( 1 , b: i) // expected-error {{passing value of type 'Int' to an inout parameter requires explicit '&'}}
450
+ let _: Color = . frob( 1 , b: i) // expected-error {{passing value of type 'Int' to an inout parameter requires explicit '&'}} {{28-28=&}}
451
451
let _: Color = . frob( 1 , & d) // expected-error {{missing argument label 'b:' in call}}
452
452
let _: Color = . frob( 1 , b: & d) // expected-error {{cannot convert value of type 'Double' to expected argument type 'Int'}}
453
453
var someColor : Color = . red // expected-error {{enum type 'Color' has no case 'red'; did you mean 'Red'}}
You can’t perform that action at this time.
0 commit comments