Skip to content

Commit 7d0e041

Browse files
committed
AutoDiff: Local workaround for invariant violation
1 parent 5ec9803 commit 7d0e041

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/SILOptimizer/Differentiation/PullbackCloner.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,11 @@ class PullbackCloner::Implementation final
225225
getPullback().getLoweredFunctionType()->getSubstGenericSignature());
226226
auto remappedSILType =
227227
SILType::getPrimitiveType(remappedType, ty.getCategory());
228-
return getPullback().mapTypeIntoContext(remappedSILType);
228+
// FIXME: Sometimes getPullback() doesn't have a generic environment, in which
229+
// case callers are apparently happy to receive an interface type.
230+
if (getPullback().getGenericEnvironment())
231+
return getPullback().mapTypeIntoContext(remappedSILType);
232+
return remappedSILType;
229233
}
230234

231235
std::optional<TangentSpace> getTangentSpace(CanType type) {

0 commit comments

Comments
 (0)