Skip to content

[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

Merged

Conversation

DougGregor
Copy link
Member

Perform basic deduplication of the nominal type declarations found via
resolveTypeDeclsToNominal(). Fixes rdar://problem/53164203

…eclsToNominal.

Perform basic deduplication of the nominal type declarations found via
resolveTypeDeclsToNominal(). Fixes rdar://problem/53164203
@DougGregor DougGregor requested a review from xedin July 16, 2019 23:56
@DougGregor
Copy link
Member Author

@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;
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member Author

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 *>'

Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny indentation

Copy link
Member Author

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

@DougGregor DougGregor merged commit f173124 into swiftlang:master Jul 17, 2019
@DougGregor DougGregor deleted the property-wrappers-ambig-53164203 branch July 17, 2019 04:07
DougGregor added a commit to DougGregor/swift that referenced this pull request Jul 19, 2019
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants