Skip to content

Commit 14b5d5b

Browse files
slavapestovktoso
authored andcommitted
Distributed: Simplify extractDistributedSerializationRequirements()
1 parent fde0cde commit 14b5d5b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/AST/DistributedDecl.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,14 +1224,13 @@ swift::extractDistributedSerializationRequirements(
12241224
DA->getAssociatedType(C.Id_SerializationRequirement);
12251225

12261226
for (auto req : allRequirements) {
1227-
if (req.getSecondType()->isAny()) {
1228-
continue;
1229-
}
1230-
if (!req.getFirstType()->hasDependentMember())
1227+
// FIXME: Seems unprincipled
1228+
if (req.getKind() != RequirementKind::SameType &&
1229+
req.getKind() != RequirementKind::Conformance)
12311230
continue;
12321231

12331232
if (auto dependentMemberType =
1234-
req.getFirstType()->castTo<DependentMemberType>()) {
1233+
req.getFirstType()->getAs<DependentMemberType>()) {
12351234
if (dependentMemberType->getAssocType() == daSerializationReqAssocType) {
12361235
auto layout = req.getSecondType()->getExistentialLayout();
12371236
for (auto p : layout.getProtocols()) {

0 commit comments

Comments
 (0)