mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Type checker] Make redeclaration checking validate fewer declarations.
Redeclaration checking was validating all declarations with the same base name as the given declaration (and in the same general nominal type), even when it was trivial to determine that the declarations could not be conflicting. Separate out the easy structural checks (based on kind, full name, instance vs. non-instance member, etc.) and perform those first, before validation. Fixes SR-6558, a case where redeclaration checking caused some unnecessary recursion in the type checker.
This commit is contained in:
@@ -193,7 +193,7 @@ bool swift::removeShadowedDecls(SmallVectorImpl<ValueDecl*> &decls,
|
||||
// constrained extensions, so use the overload signature's
|
||||
// type. This is layering a partial fix upon a total hack.
|
||||
if (auto asd = dyn_cast<AbstractStorageDecl>(decl))
|
||||
signature = asd->getOverloadSignature().InterfaceType;
|
||||
signature = asd->getOverloadSignatureType();
|
||||
|
||||
// If we've seen a declaration with this signature before, note it.
|
||||
auto &knownDecls =
|
||||
|
||||
Reference in New Issue
Block a user