Skip to content

Commit 7462f72

Browse files
committed
---
yaml --- r: 343271 b: refs/heads/master-rebranch c: 28d0c08 h: refs/heads/master i: 343269: f5dcf3f 343267: 33328b1 343263: f2ab040
1 parent 871514e commit 7462f72

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
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: 32cfd5bd19592fd281f33bbb7236ba5c74c82c6a
1458+
refs/heads/master-rebranch: 28d0c089bc442c3cbe9abb225631bd4db74af296
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/CSApply.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,6 +2266,18 @@ namespace {
22662266
if (!choice.isImplicitlyUnwrappedValueOrReturnValue())
22672267
return false;
22682268

2269+
// If we have an IUO function call and don't have a disjunction choice,
2270+
// then it means we didn't create a disjunction because the call was
2271+
// wrapped in parens (i.e. '(s.returnsAnIUO)()') and so there's no
2272+
// need to force unwrap.
2273+
if (!solution.DisjunctionChoices.count(
2274+
cs.getConstraintLocator(locator))) {
2275+
auto type = choice.getDecl()->getInterfaceType();
2276+
assert((type && type->is<AnyFunctionType>()) &&
2277+
"expected a function type");
2278+
return false;
2279+
}
2280+
22692281
auto *choiceLocator = cs.getConstraintLocator(locator.withPathElement(
22702282
ConstraintLocator::ImplicitlyUnwrappedDisjunctionChoice));
22712283

0 commit comments

Comments
 (0)