Skip to content

Commit 48ca87d

Browse files
committed
RequirementMachine: Handle type parameters in @_differentiable requirement inference
1 parent 915ae67 commit 48ca87d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/AST/RequirementMachine/RequirementLowering.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,7 @@ struct InferRequirementsWalker : public TypeWalker {
281281
auto addSameTypeConstraint = [&](Type firstType,
282282
AssociatedTypeDecl *assocType) {
283283
auto *protocol = assocType->getProtocol();
284-
auto *module = protocol->getParentModule();
285-
auto conf = module->lookupConformance(firstType, protocol);
286-
auto secondType = conf.getAssociatedType(
287-
firstType, assocType->getDeclaredInterfaceType());
284+
auto secondType = lookupMemberType(firstType, protocol, assocType);
288285
Requirement req(RequirementKind::SameType, firstType, secondType);
289286
desugarRequirement(req, reqs);
290287
};

0 commit comments

Comments
 (0)