Skip to content

Commit 695b07d

Browse files
committed
[nfc] simplify inverse matching
1 parent 4373c61 commit 695b07d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/AST/RequirementMachine/RequirementLowering.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -762,10 +762,8 @@ void swift::rewriting::realizeInheritedRequirements(
762762

763763
// For any inverses, we only need to cancel out a default requirement.
764764
if (dyn_cast_or_null<InverseTypeRepr>(typeRepr)) {
765-
if (auto protoTy = inheritedType->getAs<ProtocolType>())
766-
if (auto protoDecl = protoTy->getDecl())
767-
if (auto kp = protoDecl->getKnownProtocolKind())
768-
defaults.remove(*kp);
765+
if (auto kp = inheritedType->getKnownProtocol())
766+
defaults.remove(*kp);
769767

770768
continue;
771769
}

0 commit comments

Comments
 (0)