Skip to content

Commit 6111a6a

Browse files
committed
Sema: Replace a few mapTypeOutOfContext() calls with ArchetypeType::getInterfaceType()
1 parent e9dd400 commit 6111a6a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,8 +1879,7 @@ bool CalleeCandidateInfo::diagnoseGenericParameterErrors(Expr *badArgExpr) {
18791879
return false;
18801880

18811881
auto getGenericTypeDecl = [&](ArchetypeType *archetype) -> ValueDecl * {
1882-
auto *env = archetype->getGenericEnvironment();
1883-
auto paramType = env->mapTypeOutOfContext(archetype);
1882+
auto paramType = archetype->getInterfaceType();
18841883

18851884
if (auto *GTPT = paramType->getAs<GenericTypeParamType>())
18861885
return GTPT->getDecl();
@@ -6121,8 +6120,7 @@ bool FailureDiagnosis::diagnoseArgumentGenericRequirements(
61216120
return false;
61226121

61236122
// Record substitution from generic parameter to the argument type.
6124-
substitutions[env->mapTypeOutOfContext(archetype)
6125-
->getCanonicalType()
6123+
substitutions[archetype->getInterfaceType()->getCanonicalType()
61266124
->castTo<SubstitutableType>()] = argType;
61276125
}
61286126
}

0 commit comments

Comments
 (0)