@@ -1323,21 +1323,21 @@ 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 ) {
1326
+ if (requirement.getKind () != RequirementKind::Layout) {
1327
+ // If this is a conformance requirement, print the USR of the protocol
1328
+ // decl instead of the type. The type USR for a protocol is based on
1329
+ // the equivalent expanded existential, which drops suppressed
1330
+ // protocols.
1331
+ switch (requirement. getKind ()) {
1332
+ case RequirementKind::Conformance:
1333
+ if (Writer. isParsable () ) {
1334
1334
printReferencedDeclField (requirement.getProtocolDecl (),
1335
1335
Label::optional (" protocol" ));
1336
- } else {
1337
- printTypeField (requirement.getSecondType (),
1338
- Label::optional (" second_type" ), opts);
1336
+ break ;
1339
1337
}
1340
- } else {
1338
+ // Fallthrough to the original behavior for non-parsable output.
1339
+ LLVM_FALLTHROUGH;
1340
+ default :
1341
1341
printTypeField (requirement.getSecondType (),
1342
1342
Label::optional (" second_type" ), opts);
1343
1343
}
@@ -2022,8 +2022,8 @@ namespace {
2022
2022
Label::always (" conformances" ));
2023
2023
2024
2024
if (auto CD = dyn_cast<ClassDecl>(DC); CD && CD->hasSuperclass ()) {
2025
- printReferencedDeclField (CD->getSuperclassDecl (),
2026
- Label::always (" superclass_decl_usr " ));
2025
+ printTypeField (CD->getSuperclass (),
2026
+ Label::always (" superclass_type " ));
2027
2027
}
2028
2028
2029
2029
if (auto ED = dyn_cast<EnumDecl>(DC); ED && ED->hasRawType ()) {
0 commit comments