Skip to content

Commit b097238

Browse files
committed
---
yaml --- r: 343295 b: refs/heads/master-rebranch c: faf6ba0 h: refs/heads/master i: 343293: 6eeff77 343291: 21eb460 343287: 6fe549b 343279: d836ca6 343263: f2ab040 343231: 52d306f 343167: b57f92a 343039: ac9f22a
1 parent b561881 commit b097238

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-02-a: ddd2b2976aa9bfde5f20fe37f6bd2
14551455
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-03-a: 171cc166f2abeb5ca2a4003700a8a78a108bd300
14561456
refs/heads/benlangmuir-patch-1: baaebaf39d52f3bf36710d4fe40cf212e996b212
14571457
refs/heads/i-do-redeclare: 8c4e6d5de5c1e3f0a2cedccf319df713ea22c48e
1458-
refs/heads/master-rebranch: 016e3dc4a6f4cf3032fd1357c3e7f770835d5ec0
1458+
refs/heads/master-rebranch: faf6ba0823448d8871915afdc7917ae999b7079d
14591459
refs/heads/rdar-53901732: 9bd06af3284e18a109cdbf9aa59d833b24eeca7b
14601460
refs/heads/revert-26776-subst-always-returns-a-type: 1b8e18fdd391903a348970a4c848995d4cdd789c
14611461
refs/heads/tensorflow-merge: 8b854f62f80d4476cb383d43c4aac2001dde3cec

branches/master-rebranch/lib/Sema/CSDiagnostics.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3943,16 +3943,12 @@ bool MissingContextualConformanceFailure::diagnoseAsError() {
39433943

39443944
Optional<Diag<Type, Type>> diagnostic;
39453945
if (path.empty()) {
3946-
if (getParentExpr() && isa<CallExpr>(getParentExpr())) {
3947-
diagnostic = getDiagnosticFor(CTP_CallArgument, /*forProtocol=*/true);
3946+
assert(isa<AssignExpr>(anchor));
3947+
if (isa<SubscriptExpr>(cast<AssignExpr>(anchor)->getDest())) {
3948+
diagnostic =
3949+
getDiagnosticFor(CTP_SubscriptAssignSource, /*forProtocol=*/true);
39483950
} else {
3949-
assert(isa<AssignExpr>(anchor));
3950-
if (isa<SubscriptExpr>(cast<AssignExpr>(anchor)->getDest())) {
3951-
diagnostic =
3952-
getDiagnosticFor(CTP_SubscriptAssignSource, /*forProtocol=*/true);
3953-
} else {
3954-
diagnostic = getDiagnosticFor(CTP_AssignSource, /*forProtocol=*/true);
3955-
}
3951+
diagnostic = getDiagnosticFor(CTP_AssignSource, /*forProtocol=*/true);
39563952
}
39573953
} else {
39583954
const auto &last = path.back();

0 commit comments

Comments
 (0)