File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -229,12 +229,20 @@ FailureDiagnostic::getFunctionArgApplyInfo(ConstraintLocator *locator) const {
229
229
choice = overload->choice ;
230
230
rawFnType = overload->openedType ;
231
231
} else {
232
- // If we didn't resolve an overload for the callee, we must be dealing with
233
- // a call of an arbitrary function expr.
234
- auto *call = cast<CallExpr>(anchor);
235
- assert (!shouldHaveDirectCalleeOverload (call) &&
236
- " Should we have resolved a callee for this?" );
237
- rawFnType = cs.getType (call->getFn ());
232
+ // If we didn't resolve an overload for the callee, we should be dealing
233
+ // with a call of an arbitrary function expr.
234
+ if (auto *call = dyn_cast<CallExpr>(anchor)) {
235
+ assert (!shouldHaveDirectCalleeOverload (call) &&
236
+ " Should we have resolved a callee for this?" );
237
+ rawFnType = cs.getType (call->getFn ());
238
+ } else {
239
+ // FIXME: ArgumentMismatchFailure is currently used from CSDiag, meaning
240
+ // we can end up a BinaryExpr here with an unresolved callee. It should be
241
+ // possible to remove this once we've gotten rid of the old CSDiag logic
242
+ // and just assert that we have a CallExpr.
243
+ auto *apply = cast<ApplyExpr>(anchor);
244
+ rawFnType = cs.getType (apply->getFn ());
245
+ }
238
246
}
239
247
240
248
// Try to resolve the function type by loading lvalues and looking through
You can’t perform that action at this time.
0 commit comments