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 {
2113
2113
if (!normal)
2114
2114
return ;
2115
2115
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
+
2118
2130
if (condReqs.empty ()) {
2119
2131
// For a protocol P that conforms to another protocol, introduce a
2120
2132
// conditional requirement for that P's Self: P. This aligns with
2121
2133
// SILWitnessTable::enumerateWitnessTableConditionalConformances().
2122
2134
if (auto selfProto = normal->getDeclContext ()->getSelfProtocolDecl ()) {
2123
2135
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 ());
2127
2138
}
2128
2139
2129
2140
if (condReqs.empty ())
You can’t perform that action at this time.
0 commit comments