@@ -295,8 +295,19 @@ void ConformanceLookupTable::updateLookupTable(NominalTypeDecl *nominal,
295
295
forEachInStage (
296
296
stage, nominal,
297
297
[&](NominalTypeDecl *nominal) {
298
- addInheritedProtocols (nominal,
299
- ConformanceSource::forExplicit (nominal));
298
+ auto source = ConformanceSource::forExplicit (nominal);
299
+
300
+ // Get all of the protocols in the inheritance clause.
301
+ InvertibleProtocolSet inverses;
302
+ bool anyObject = false ;
303
+ for (const auto &found :
304
+ getDirectlyInheritedNominalTypeDecls (nominal, inverses, anyObject)) {
305
+ if (auto proto = dyn_cast<ProtocolDecl>(found.Item )) {
306
+ addProtocol (proto, found.Loc ,
307
+ source.withUncheckedLoc (found.uncheckedLoc )
308
+ .withPreconcurrencyLoc (found.preconcurrencyLoc ));
309
+ }
310
+ }
300
311
301
312
addMacroGeneratedProtocols (
302
313
nominal, ConformanceSource::forUnexpandedMacro (nominal));
@@ -494,22 +505,6 @@ bool ConformanceLookupTable::addProtocol(ProtocolDecl *protocol, SourceLoc loc,
494
505
return true ;
495
506
}
496
507
497
- void ConformanceLookupTable::addInheritedProtocols (
498
- llvm::PointerUnion<const TypeDecl *, const ExtensionDecl *> decl,
499
- ConformanceSource source) {
500
- // Find all of the protocols in the inheritance list.
501
- InvertibleProtocolSet inverses;
502
- bool anyObject = false ;
503
- for (const auto &found :
504
- getDirectlyInheritedNominalTypeDecls (decl, inverses, anyObject)) {
505
- if (auto proto = dyn_cast<ProtocolDecl>(found.Item )) {
506
- addProtocol (proto, found.Loc ,
507
- source.withUncheckedLoc (found.uncheckedLoc )
508
- .withPreconcurrencyLoc (found.preconcurrencyLoc ));
509
- }
510
- }
511
- }
512
-
513
508
void ConformanceLookupTable::addMacroGeneratedProtocols (
514
509
NominalTypeDecl *nominal, ConformanceSource source) {
515
510
nominal->forEachAttachedMacro (
0 commit comments