@@ -1323,27 +1323,19 @@ namespace {
1323
1323
1324
1324
printField (requirement.getKind (), Label::optional (" kind" ));
1325
1325
1326
- if (requirement.getKind () != RequirementKind::Layout &&
1327
- requirement.getSecondType ()) {
1328
- if (Writer.isParsable ()) {
1329
- // If this is a conformance requirement, print the USR of the protocol
1330
- // decl instead of the type. The type USR for a protocol is based on
1331
- // the equivalent expanded existential, which drops suppressed
1332
- // protocols.
1333
- if (requirement.getKind () == RequirementKind::Conformance) {
1334
- printReferencedDeclField (requirement.getProtocolDecl (),
1335
- Label::optional (" protocol" ));
1336
- } else {
1337
- printTypeField (requirement.getSecondType (),
1338
- Label::optional (" second_type" ), opts);
1339
- }
1340
- } else {
1341
- printTypeField (requirement.getSecondType (),
1342
- Label::optional (" second_type" ), opts);
1343
- }
1344
- } else if (requirement.getLayoutConstraint ())
1326
+ switch (requirement.getKind ()) {
1327
+ case RequirementKind::Layout:
1345
1328
printFieldQuoted (requirement.getLayoutConstraint (),
1346
1329
Label::optional (" layout" ));
1330
+ break ;
1331
+ case RequirementKind::Conformance:
1332
+ printReferencedDeclField (requirement.getProtocolDecl (),
1333
+ Label::optional (" protocol" ));
1334
+ break ;
1335
+ default :
1336
+ printTypeField (requirement.getSecondType (),
1337
+ Label::optional (" second_type" ), opts);
1338
+ }
1347
1339
1348
1340
printFoot ();
1349
1341
}
@@ -2022,8 +2014,8 @@ namespace {
2022
2014
Label::always (" conformances" ));
2023
2015
2024
2016
if (auto CD = dyn_cast<ClassDecl>(DC); CD && CD->hasSuperclass ()) {
2025
- printReferencedDeclField (CD->getSuperclassDecl (),
2026
- Label::always (" superclass_decl_usr " ));
2017
+ printTypeField (CD->getSuperclass (),
2018
+ Label::always (" superclass_type " ));
2027
2019
}
2028
2020
2029
2021
if (auto ED = dyn_cast<EnumDecl>(DC); ED && ED->hasRawType ()) {
0 commit comments