File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -195,9 +195,21 @@ class TypeMatcher {
195
195
TRIVIAL_CASE (ModuleType)
196
196
TRIVIAL_CASE (DynamicSelfType)
197
197
TRIVIAL_CASE (ArchetypeType)
198
- TRIVIAL_CASE (GenericTypeParamType)
199
198
TRIVIAL_CASE (DependentMemberType)
200
199
200
+ bool visitGenericTypeParamType (CanGenericTypeParamType firstType,
201
+ Type secondType,
202
+ Type sugaredFirstType) {
203
+ /* If the types match, continue. */
204
+ if (!Matcher.asDerived ().alwaysMismatchGenericParams () &&
205
+ firstType->isEqual (secondType))
206
+ return true ;
207
+
208
+ /* Otherwise, let the derived class deal with the mismatch. */
209
+ return mismatch (firstType.getPointer (), secondType,
210
+ sugaredFirstType);
211
+ }
212
+
201
213
// / FIXME: Split this out into cases?
202
214
bool visitAnyFunctionType (CanAnyFunctionType firstFunc, Type secondType,
203
215
Type sugaredFirstType) {
@@ -300,6 +312,8 @@ class TypeMatcher {
300
312
#undef TRIVIAL_CASE
301
313
};
302
314
315
+ bool alwaysMismatchGenericParams () const { return false ; }
316
+
303
317
ImplClass &asDerived () { return static_cast <ImplClass &>(*this ); }
304
318
305
319
const ImplClass &asDerived () const {
You can’t perform that action at this time.
0 commit comments