@@ -1269,7 +1269,6 @@ bestRequirementPrintLocation(ProtocolDecl *proto, const Requirement &req) {
1269
1269
1270
1270
void PrintAST::printInheritedFromRequirementSignature (ProtocolDecl *proto,
1271
1271
Decl *attachingTo) {
1272
- assert (proto->isRequirementSignatureComputed ());
1273
1272
printGenericSignature (
1274
1273
GenericSignature::get ({proto->getProtocolSelfType ()} ,
1275
1274
proto->getRequirementSignature ()),
@@ -1282,7 +1281,6 @@ void PrintAST::printInheritedFromRequirementSignature(ProtocolDecl *proto,
1282
1281
1283
1282
void PrintAST::printWhereClauseFromRequirementSignature (ProtocolDecl *proto,
1284
1283
Decl *attachingTo) {
1285
- assert (proto->isRequirementSignatureComputed ());
1286
1284
unsigned flags = PrintRequirements;
1287
1285
if (isa<AssociatedTypeDecl>(attachingTo))
1288
1286
flags |= SwapSelfAndDependentMemberType;
@@ -2316,11 +2314,7 @@ void PrintAST::visitAssociatedTypeDecl(AssociatedTypeDecl *decl) {
2316
2314
});
2317
2315
2318
2316
auto proto = decl->getProtocol ();
2319
- if (proto->isRequirementSignatureComputed ()) {
2320
- printInheritedFromRequirementSignature (proto, decl);
2321
- } else {
2322
- printInherited (decl);
2323
- }
2317
+ printInheritedFromRequirementSignature (proto, decl);
2324
2318
2325
2319
if (decl->hasDefaultDefinitionType ()) {
2326
2320
Printer << " = " ;
@@ -2329,13 +2323,7 @@ void PrintAST::visitAssociatedTypeDecl(AssociatedTypeDecl *decl) {
2329
2323
2330
2324
// As with protocol's trailing where clauses, use the requirement signature
2331
2325
// when available.
2332
- if (proto->isRequirementSignatureComputed ()) {
2333
- printWhereClauseFromRequirementSignature (proto, decl);
2334
- } else {
2335
- if (auto trailingWhere = decl->getTrailingWhereClause ()) {
2336
- printTrailingWhereClause (trailingWhere);
2337
- }
2338
- }
2326
+ printWhereClauseFromRequirementSignature (proto, decl);
2339
2327
}
2340
2328
2341
2329
void PrintAST::visitEnumDecl (EnumDecl *decl) {
@@ -2442,23 +2430,13 @@ void PrintAST::visitProtocolDecl(ProtocolDecl *decl) {
2442
2430
Printer.printName (decl->getName ());
2443
2431
});
2444
2432
2445
- if (decl->isRequirementSignatureComputed ()) {
2446
- printInheritedFromRequirementSignature (decl, decl);
2447
- } else {
2448
- printInherited (decl);
2449
- }
2433
+ printInheritedFromRequirementSignature (decl, decl);
2450
2434
2451
2435
// The trailing where clause is a syntactic thing, which isn't serialized
2452
2436
// (etc.) and thus isn't available for printing things out of
2453
2437
// already-compiled SIL modules. The requirement signature is available in
2454
2438
// such cases, so let's go with that when we can.
2455
- if (decl->isRequirementSignatureComputed ()) {
2456
- printWhereClauseFromRequirementSignature (decl, decl);
2457
- } else {
2458
- if (auto trailingWhere = decl->getTrailingWhereClause ()) {
2459
- printTrailingWhereClause (trailingWhere);
2460
- }
2461
- }
2439
+ printWhereClauseFromRequirementSignature (decl, decl);
2462
2440
}
2463
2441
if (Options.TypeDefinitions ) {
2464
2442
printMembersOfDecl (decl, false , true ,
0 commit comments