File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -4358,10 +4358,16 @@ ConstraintResult GenericSignatureBuilder::addTypeRequirement(
43584358 ->getDependentType (getGenericParams ());
43594359
43604360 Impl->HadAnyError = true ;
4361-
4361+
43624362 if (subjectType->is <DependentMemberType>()) {
43634363 subjectType = resolveDependentMemberTypes (*this , subjectType);
4364- } else {
4364+ }
4365+
4366+ if (!subjectType->is <DependentMemberType>()) {
4367+ // If we end up here, it means either the subject type was never a
4368+ // a dependent member type, or it was initially a dependent member
4369+ // type, but resolving it lead to some other type. Let's map this
4370+ // to an error type so we can emit correct diagnostics.
43654371 subjectType = ErrorType::get (subjectType);
43664372 }
43674373
Original file line number Diff line number Diff line change @@ -109,3 +109,14 @@ struct UsesSameTypedDefaultDerivedWithoutSatisfyingReqts: SameTypedDefaultDerive
109109 static var y : YType { return YType ( ) }
110110}
111111
112+ // SR-12199
113+
114+ protocol SR_12199_P1 {
115+ associatedtype Assoc
116+ }
117+
118+ enum SR_12199_E { }
119+
120+ protocol SR_12199_P2 : SR_12199_P1 where Assoc == SR_12199_E {
121+ associatedtype Assoc : SR_12199_E // expected-error {{type 'Self.Assoc' constrained to non-protocol, non-class type 'SR_12199_E'}}
122+ }
You can’t perform that action at this time.
0 commit comments