Skip to content

Commit 4c22395

Browse files
slavapestovktoso
authored andcommitted
Distributed: Remove flattenDistributedSerializationTypeToRequiredProtocols()
1 parent cbde186 commit 4c22395

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

lib/AST/DistributedDecl.cpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,11 @@ swift::getDistributedSerializationRequirements(
341341
return true; // we're done here, any means there are no requirements
342342

343343
auto *serialReqType = existentialRequirementTy->getAs<ExistentialType>();
344-
->getAs<ExistentialType>();
345344
if (!serialReqType || serialReqType->hasError()) {
346345
return false;
347346
}
348347

349-
auto desugaredTy = serialReqType->getConstraintType();
348+
auto layout = serialReqType->getExistentialLayout();
350349
for (auto p : layout.getProtocols()) {
351350
requirementProtos.insert(p);
352351
}
@@ -1234,16 +1233,20 @@ swift::extractDistributedSerializationRequirements(
12341233
if (auto dependentMemberType =
12351234
req.getFirstType()->castTo<DependentMemberType>()) {
12361235
if (dependentMemberType->getAssocType() == daSerializationReqAssocType) {
1237-
auto requirementProto = req.getSecondType();
1238-
if (auto proto = dyn_cast_or_null<ProtocolDecl>(
1239-
requirementProto->getAnyNominal())) {
1240-
into.insert(proto);
1241-
} else {
1242-
auto serialReqType = requirementProto->castTo<ExistentialType>()
1243-
->getConstraintType();
1244-
auto flattenedRequirements =
1245-
flattenDistributedSerializationTypeToRequiredProtocols(
1246-
serialReqType.getPointer());
1236+
// auto requirementProto = req.getSecondType();
1237+
// if (auto proto = dyn_cast_or_null<ProtocolDecl>(
1238+
// requirementProto->getAnyNominal())) {
1239+
// into.insert(proto);
1240+
// } else {
1241+
// auto serialReqType = requirementProto->castTo<ExistentialType>()
1242+
// ->getConstraintType();
1243+
// auto flattenedRequirements =
1244+
// flattenDistributedSerializationTypeToRequiredProtocols(
1245+
// serialReqType.getPointer());
1246+
// for (auto p : flattenedRequirements) {
1247+
// into.insert(p);
1248+
// }
1249+
auto layout = req.getSecondType()->getExistentialLayout();
12471250
for (auto p : layout.getProtocols()) {
12481251
serializationReqs.insert(p);
12491252
}

0 commit comments

Comments
 (0)