Skip to content

Commit 48d14db

Browse files
committed
---
yaml --- r: 348854 b: refs/heads/master c: f03d210 h: refs/heads/master
1 parent 899073e commit 48d14db

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: ec45b24b630a1491b821edb6b0c625e37e9d650f
2+
refs/heads/master: f03d210be9e0354a66be8a1cc769d085f3a71c85
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/Sema/CSDiagnostics.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,20 @@ FailureDiagnostic::getFunctionArgApplyInfo(ConstraintLocator *locator) const {
229229
choice = overload->choice;
230230
rawFnType = overload->openedType;
231231
} 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+
}
238246
}
239247

240248
// Try to resolve the function type by loading lvalues and looking through

0 commit comments

Comments
 (0)