File tree Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -747,13 +747,13 @@ SpecializedProtocolConformance::SpecializedProtocolConformance(
747
747
// terms of the specialized types, not the conformance-declaring decl's
748
748
// types.
749
749
auto nominal = GenericConformance->getType ()->getAnyNominal ();
750
- auto subMap =
751
- getType ()->getContextSubstitutionMap (nominal->getModuleContext (),
752
- nominal);
750
+ auto module = nominal->getModuleContext ();
751
+ auto subMap = getType ()->getContextSubstitutionMap (module , nominal);
753
752
754
753
SmallVector<Requirement, 4 > newReqs;
755
754
for (auto oldReq : GenericConformance->getConditionalRequirements ()) {
756
- if (auto newReq = oldReq.subst (subMap))
755
+ if (auto newReq = oldReq.subst (QuerySubstitutionMap{subMap},
756
+ LookUpConformanceInModule (module )))
757
757
newReqs.push_back (*newReq);
758
758
}
759
759
auto &ctxt = getProtocol ()->getASTContext ();
Original file line number Diff line number Diff line change @@ -334,3 +334,29 @@ func existential_bad<T>(_: T.Type) {
334
334
_ = Free < T > ( ) as P2 // expected-error{{'Free<T>' is not convertible to 'P2'; did you mean to use 'as!' to force downcast?}}
335
335
}
336
336
337
+ // rdar://problem/35837054
338
+ protocol P7 { }
339
+
340
+ protocol P8 {
341
+ associatedtype A
342
+ }
343
+
344
+ struct X0 { }
345
+
346
+ struct X1 { }
347
+
348
+ extension X1 : P8 {
349
+ typealias A = X0
350
+ }
351
+
352
+ struct X2 < T> { }
353
+
354
+ extension X2 : P7 where T: P8 , T. A: P7 { }
355
+
356
+ func takesF7< T: P7 > ( _: T ) { }
357
+ func passesConditionallyNotF7( x21: X2 < X1 > ) {
358
+ takesF7 ( x21) // expected-error{{type 'X1.A' (aka 'X0') does not conform to protocol 'P7'}}
359
+ // expected-error@-1{{'<T where T : P7> (T) -> ()' requires that 'X1.A' (aka 'X0') conform to 'P7'}}
360
+ // expected-note@-2{{requirement specified as 'X1.A' (aka 'X0') : 'P7'}}
361
+ // expected-note@-3{{requirement from conditional conformance of 'X2<X1>' to 'P7'}}
362
+ }
You can’t perform that action at this time.
0 commit comments