Skip to content

Commit 7b8e26b

Browse files
committed
AST: Remove unnecessary canonicalization step in SubstitutionMap::lookupConformance()
1 parent a8452b4 commit 7b8e26b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/AST/SubstitutionMap.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,8 @@ SubstitutionMap::lookupConformance(CanType type, ProtocolDecl *proto) const {
124124
if (!genericSig->conformsToProtocol(type, proto, mod))
125125
return None;
126126

127-
auto canonType = genericSig->getCanonicalTypeInContext(type, mod);
128127
auto accessPath =
129-
genericSig->getConformanceAccessPath(canonType, proto, mod);
128+
genericSig->getConformanceAccessPath(type, proto, mod);
130129

131130
// Fall through because we cannot yet evaluate an access path.
132131
Optional<ProtocolConformanceRef> conformance;
@@ -153,7 +152,7 @@ SubstitutionMap::lookupConformance(CanType type, ProtocolDecl *proto) const {
153152

154153
// If we haven't set the signature conformances yet, force the issue now.
155154
if (normal->getSignatureConformances().empty()) {
156-
auto lazyResolver = canonType->getASTContext().getLazyResolver();
155+
auto lazyResolver = type->getASTContext().getLazyResolver();
157156
lazyResolver->resolveTypeWitness(normal, nullptr);
158157

159158
// Error case: the conformance is broken, so we cannot handle this

0 commit comments

Comments
 (0)