File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
lib/AST/RequirementMachine Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -195,13 +195,25 @@ class TypeMatcher {
195
195
TRIVIAL_CASE (ModuleType)
196
196
TRIVIAL_CASE (DynamicSelfType)
197
197
TRIVIAL_CASE (ArchetypeType)
198
- TRIVIAL_CASE (DependentMemberType)
198
+
199
+ bool visitDependentMemberType (CanDependentMemberType firstType,
200
+ Type secondType,
201
+ Type sugaredFirstType) {
202
+ /* If the types match, continue. */
203
+ if (!Matcher.asDerived ().alwaysMismatchTypeParameters () &&
204
+ firstType->isEqual (secondType))
205
+ return true ;
206
+
207
+ /* Otherwise, let the derived class deal with the mismatch. */
208
+ return mismatch (firstType.getPointer (), secondType,
209
+ sugaredFirstType);
210
+ }
199
211
200
212
bool visitGenericTypeParamType (CanGenericTypeParamType firstType,
201
213
Type secondType,
202
214
Type sugaredFirstType) {
203
215
/* If the types match, continue. */
204
- if (!Matcher.asDerived ().alwaysMismatchGenericParams () &&
216
+ if (!Matcher.asDerived ().alwaysMismatchTypeParameters () &&
205
217
firstType->isEqual (secondType))
206
218
return true ;
207
219
@@ -312,7 +324,7 @@ class TypeMatcher {
312
324
#undef TRIVIAL_CASE
313
325
};
314
326
315
- bool alwaysMismatchGenericParams () const { return false ; }
327
+ bool alwaysMismatchTypeParameters () const { return false ; }
316
328
317
329
ImplClass &asDerived () { return static_cast <ImplClass &>(*this ); }
318
330
Original file line number Diff line number Diff line change @@ -387,7 +387,7 @@ static bool unifyConcreteTypes(
387
387
rhsSubstitutions (rhsSubstitutions),
388
388
ctx(ctx), inducedRules(inducedRules), debug(debug) {}
389
389
390
- bool alwaysMismatchGenericParams () const { return true ; }
390
+ bool alwaysMismatchTypeParameters () const { return true ; }
391
391
392
392
bool mismatch (TypeBase *firstType, TypeBase *secondType,
393
393
Type sugaredFirstType) {
You can’t perform that action at this time.
0 commit comments