File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1457,4 +1457,4 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-02-a: ddd2b2976aa9bfde5f20fe37f6bd2
1457
1457
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-03-a: 171cc166f2abeb5ca2a4003700a8a78a108bd300
1458
1458
refs/heads/benlangmuir-patch-1: baaebaf39d52f3bf36710d4fe40cf212e996b212
1459
1459
refs/heads/i-do-redeclare: 8c4e6d5de5c1e3f0a2cedccf319df713ea22c48e
1460
- refs/heads/master-rebranch: f6b90145b01ae4657b5db2009b8df056428b92e6
1460
+ refs/heads/master-rebranch: 67b3abe48199afd3029e7051250a3ecaafed70b4
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ ProtocolConformance *RequirementFailure::getConformanceForConditionalReq(
134
134
135
135
ValueDecl *RequirementFailure::getDeclRef () const {
136
136
auto &cs = getConstraintSystem ();
137
+ auto &TC = getTypeChecker ();
137
138
138
139
auto *anchor = getRawAnchor ();
139
140
auto *locator = cs.getConstraintLocator (anchor);
@@ -156,7 +157,7 @@ ValueDecl *RequirementFailure::getDeclRef() const {
156
157
} else if (auto *UDE = dyn_cast<UnresolvedDotExpr>(anchor)) {
157
158
ConstraintLocatorBuilder member (locator);
158
159
159
- if (UDE-> getName (). isSimpleName ( DeclBaseName::createConstructor () )) {
160
+ if (TC. getSelfForInitDelegationInConstructor ( getDC (), UDE )) {
160
161
member = member.withPathElement (PathEltKind::ConstructorMember);
161
162
} else {
162
163
member = member.withPathElement (PathEltKind::Member);
Original file line number Diff line number Diff line change @@ -677,3 +677,13 @@ protocol C {
677
677
protocol D {
678
678
associatedtype Foo where Foo: String // expected-error {{type 'Self.Foo' constrained to non-protocol, non-class type 'String'}}
679
679
}
680
+
681
+ func member_ref_with_explicit_init( ) {
682
+ struct S < T: P > { // expected-note {{where 'T' = 'Int'}}
683
+ init ( _: T ) { }
684
+ init ( _: T , _ other: Int = 42 ) { }
685
+ }
686
+
687
+ _ = S . init ( 42 )
688
+ // expected-error@-1 {{generic struct 'S' requires that 'Int' conform to 'P'}}
689
+ }
You can’t perform that action at this time.
0 commit comments