-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Name lookup] Deduplicate nominal declarations found via resolveTypeDeclsToNominal #26174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Name lookup] Deduplicate nominal declarations found via resolveTypeDeclsToNominal #26174
Conversation
…eclsToNominal. Perform basic deduplication of the nominal type declarations found via resolveTypeDeclsToNominal(). Fixes rdar://problem/53164203
@swift-ci please smoke test |
@@ -1734,12 +1734,17 @@ resolveTypeDeclsToNominal(Evaluator &evaluator, | |||
SmallVectorImpl<ModuleDecl *> &modulesFound, | |||
bool &anyObject, | |||
llvm::SmallPtrSetImpl<TypeAliasDecl *> &typealiases) { | |||
SmallPtrSet<NominalTypeDecl *, 4> knownNominalDecls; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would SetVector<NominalTypeDecl *, TinyPtrVector<NominalTypeDecl *>, SmallPtrSet<NominalTypeDecl *, 4>>
make this simpler or more complicated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's clever to simplify it. Then I can use takeVector
to steal its vector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sigh.
error: no type named 'size_type' in 'llvm::TinyPtrVector<swift::NominalTypeDecl *>'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sigh.
@@ -0,0 +1,8 @@ | |||
@propertyWrapper | |||
public struct Wrapper<Value> { | |||
public var wrappedValue: Value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funny indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, annoying. I'll clean it up in a follow-up
This was fixed by pull request swiftlang#26174, but the test case there was specific to property wrappers, while the fix also addresses issues with other ambiguity name lookups such as protocol names in an inheritance clause.
Perform basic deduplication of the nominal type declarations found via
resolveTypeDeclsToNominal()
. Fixes rdar://problem/53164203