File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,20 @@ Type DependentGenericTypeResolver::resolveDependentMemberType(
43
43
}
44
44
45
45
bool DependentGenericTypeResolver::areSameType (Type type1, Type type2) {
46
- if (!type1->hasTypeParameter () && !type2->hasTypeParameter ())
47
- return type1->isEqual (type2);
46
+ if (type1->isEqual (type2))
47
+ return true ;
48
+
49
+ // If both refer to associated types with the same name, they'll implicitly
50
+ // be considered equivalent.
51
+ auto depMem1 = type1->getAs <DependentMemberType>();
52
+ if (!depMem1) return false ;
48
53
49
- // Conservative answer: they could be the same.
50
- return true ;
54
+ auto depMem2 = type2->getAs <DependentMemberType>();
55
+ if (!depMem2) return false ;
56
+
57
+ if (depMem1->getName () != depMem2->getName ()) return false ;
58
+
59
+ return areSameType (depMem1->getBase (), depMem2->getBase ());
51
60
}
52
61
53
62
Type GenericTypeToArchetypeResolver::mapTypeIntoContext (Type type) {
You can’t perform that action at this time.
0 commit comments