Skip to content

Commit a816489

Browse files
committed
RequirementLowering: remove assert
Finding a structural requirement that is not involving an invertible protocol is not suspicious at all.
1 parent 9f3743d commit a816489

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

lib/AST/RequirementMachine/RequirementLowering.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -810,15 +810,9 @@ void swift::rewriting::applyInverses(
810810
return false;
811811

812812
// Only consider requirements involving an invertible protocol.
813-
llvm::Optional<InvertibleProtocolKind> proto;
814-
if (auto kp = req.getProtocolDecl()->getKnownProtocolKind())
815-
if (auto ip = getInvertibleProtocolKind(*kp))
816-
proto = *ip;
817-
818-
if (!proto) {
819-
assert(false && "suspicious!");
813+
auto proto = req.getProtocolDecl()->getInvertibleProtocolKind();
814+
if (!proto)
820815
return false;
821-
}
822816

823817
// See if this subject is in-scope.
824818
auto subject = req.getFirstType()->getCanonicalType();

0 commit comments

Comments
 (0)