File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -2113,17 +2113,28 @@ namespace {
21132113 if (!normal)
21142114 return ;
21152115
2116- std::optional<Requirement> scratchRequirement;
2117- auto condReqs = normal->getConditionalRequirements ();
2116+ SmallVector<Requirement, 2 > condReqs;
2117+ {
2118+ // FIXME(kavon): probably need to emit the inverse requirements in the
2119+ // metadata so the runtime knows not to check for Copyable? For now
2120+ // filter them out.
2121+ auto origCondReqs = normal->getConditionalRequirements ();
2122+ for (auto req : origCondReqs) {
2123+ if (req.getKind () == RequirementKind::Conformance &&
2124+ req.getProtocolDecl ()->getInvertibleProtocolKind ())
2125+ continue ;
2126+ condReqs.push_back (req);
2127+ }
2128+ }
2129+
21182130 if (condReqs.empty ()) {
21192131 // For a protocol P that conforms to another protocol, introduce a
21202132 // conditional requirement for that P's Self: P. This aligns with
21212133 // SILWitnessTable::enumerateWitnessTableConditionalConformances().
21222134 if (auto selfProto = normal->getDeclContext ()->getSelfProtocolDecl ()) {
21232135 auto selfType = selfProto->getSelfInterfaceType ()->getCanonicalType ();
2124- scratchRequirement.emplace (RequirementKind::Conformance, selfType,
2125- selfProto->getDeclaredInterfaceType ());
2126- condReqs = *scratchRequirement;
2136+ condReqs.emplace_back (RequirementKind::Conformance, selfType,
2137+ selfProto->getDeclaredInterfaceType ());
21272138 }
21282139
21292140 if (condReqs.empty ())
You can’t perform that action at this time.
0 commit comments