Skip to content

Commit d875452

Browse files
committed
---
yaml --- r: 343274 b: refs/heads/master-rebranch c: b32386b h: refs/heads/master
1 parent 1f3af70 commit d875452

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
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: 532498bae54188dfe22986516ee457e18673f196
1458+
refs/heads/master-rebranch: b32386bcacbf2c585fbb7af42505d43e88c45f34
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/ConstraintSystem.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,9 +2199,14 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
21992199
if (!type || !type->is<AnyFunctionType>())
22002200
return false;
22012201

2202-
auto paren = getParentExpr(locator->getAnchor());
2203-
auto result = paren ? isa<ParenExpr>(paren) : false;
2204-
return result;
2202+
if (auto call = dyn_cast<CallExpr>(locator->getAnchor()))
2203+
return call->getSemanticFn() != call->getFn();
2204+
2205+
if (auto paren = getParentExpr(locator->getAnchor())) {
2206+
return isa<ParenExpr>(paren);
2207+
}
2208+
2209+
return false;
22052210
};
22062211

22072212
// In some cases we already created the appropriate bind constraints.

branches/master-rebranch/test/Constraints/iuo.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,14 @@ let sr_10492_int1: Int = (sr_10492_s.foo)() // expected-error {{value of optiona
235235
// expected-note@-1 {{coalesce}}{{44-44= ?? <#default value#>}}
236236
// expected-note@-2 {{force-unwrap}}{{44-44=!}}
237237
let sr_10492_int2: Int? = (sr_10492_s.foo)() // Okay
238+
239+
240+
class SR_10492_C1 {
241+
init!() {}
242+
}
243+
244+
class SR_10492_C2 {
245+
init(_ foo: SR_10492_C1) {}
246+
}
247+
248+
let bar = SR_10492_C2(SR_10492_C1()) // Okay

0 commit comments

Comments
 (0)