File tree 2 files changed +19
-2
lines changed
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -4358,10 +4358,16 @@ ConstraintResult GenericSignatureBuilder::addTypeRequirement(
4358
4358
->getDependentType (getGenericParams ());
4359
4359
4360
4360
Impl->HadAnyError = true ;
4361
-
4361
+
4362
4362
if (subjectType->is <DependentMemberType>()) {
4363
4363
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.
4365
4371
subjectType = ErrorType::get (subjectType);
4366
4372
}
4367
4373
Original file line number Diff line number Diff line change @@ -109,3 +109,14 @@ struct UsesSameTypedDefaultDerivedWithoutSatisfyingReqts: SameTypedDefaultDerive
109
109
static var y : YType { return YType ( ) }
110
110
}
111
111
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