File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
lib/SILOptimizer/Differentiation Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -2035,12 +2035,10 @@ void PullbackCloner::Implementation::accumulateAdjointForOptional(
2035
2035
SILBasicBlock *bb, SILValue optionalValue, SILValue wrappedAdjoint) {
2036
2036
auto pbLoc = getPullback ().getLocation ();
2037
2037
// Handle `switch_enum` on `Optional`.
2038
- auto *optionalEnumDecl = getASTContext ().getOptionalDecl ();
2039
- auto optionalTy = optionalValue->getType ();
2040
- assert (optionalTy.getASTType ().getEnumOrBoundGenericEnum () ==
2041
- optionalEnumDecl);
2042
2038
// `Optional<T>`
2043
- optionalTy = remapType (optionalTy);
2039
+ auto optionalTy = remapType (optionalValue->getType ());
2040
+ assert (optionalTy.getASTType ().getEnumOrBoundGenericEnum () ==
2041
+ getASTContext ().getOptionalDecl ());
2044
2042
// `T`
2045
2043
auto wrappedType = optionalTy.getOptionalObjectType ();
2046
2044
// `T.TangentVector`
You can’t perform that action at this time.
0 commit comments