Skip to content

Commit 2a45cd2

Browse files
committed
[AutoDiff] Fix unexpected non-differentiable property access error.
Fix base tangent type calculation.
1 parent c2cb48d commit 2a45cd2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/AST/AutoDiff.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,9 +505,9 @@ TangentPropertyInfo TangentStoredPropertyRequest::evaluate(
505505
TangentPropertyInfo::Error::Kind::OriginalPropertyNotDifferentiable);
506506
}
507507
// Get the parent `TangentVector` type.
508-
auto memberSubs = baseType->getMemberSubstitutionMap(
509-
originalField->getModuleContext(), originalField);
510-
auto parentTanType = parentTan->getType().subst(memberSubs);
508+
auto parentTanType =
509+
baseType->getAutoDiffTangentSpace(LookUpConformanceInModule(moduleDecl))
510+
->getType();
511511
auto *parentTanStruct = parentTanType->getStructOrBoundGenericStruct();
512512
// Error if parent `TangentVector` is not a struct.
513513
if (!parentTanStruct) {

0 commit comments

Comments
 (0)