Skip to content

Commit 91e231f

Browse files
authored
Merge pull request #9038 from DougGregor/submap-inherited-hack-4.0
[4.0] [Substitution map] Hack: look at inherited conformances in lookupConformance
2 parents ac11c53 + 41f4ec6 commit 91e231f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/AST/SubstitutionMap.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ SubstitutionMap::lookupConformance(CanType type, ProtocolDecl *proto) const {
107107
return conformance;
108108
}
109109

110+
// FIXME: Hack to deal with substitution maps created with incorrect
111+
// conformances. This better go away soon or I'll be sad.
112+
for (auto conformance : known->second) {
113+
if (conformance.getRequirement()->inheritsFrom(proto))
114+
return conformance.getInherited(proto);
115+
}
116+
110117
return None;
111118
};
112119

0 commit comments

Comments
 (0)