File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: ec45b24b630a1491b821edb6b0c625e37e9d650f
2
+ refs/heads/master: f03d210be9e0354a66be8a1cc769d085f3a71c85
3
3
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
4
4
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
5
5
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
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