Skip to content

Commit 5e2f5d6

Browse files
committed
SILGen: Catch an unnecessary mapTypeIntoContext() call
1 parent 872d473 commit 5e2f5d6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/SIL/SILFunction.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ SILType SILFunction::mapTypeIntoContext(SILType type) const {
171171

172172
SILType GenericEnvironment::mapTypeIntoContext(SILModule &M,
173173
SILType type) const {
174+
assert(!type.hasArchetype());
175+
174176
auto genericSig = getGenericSignature()->getCanonicalSignature();
175177
return type.subst(M,
176178
QueryInterfaceTypeSubstitutions(this),

lib/SILGen/SILGenPoly.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,6 @@ namespace {
10631063
outputOrigType, outputTupleType,
10641064
loweredTy);
10651065

1066-
optionalTy = SGF.F.mapTypeIntoContext(optionalTy);
10671066
auto optional = SGF.B.createEnum(Loc, payload.getValue(),
10681067
someDecl, optionalTy);
10691068
return ManagedValue(optional, payload.getCleanup());

0 commit comments

Comments
 (0)