Skip to content

[IDE] Compute type relations for attributes for generic property wrapper types #63752

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

ahoppen
Copy link
Member

@ahoppen ahoppen commented Feb 17, 2023

The existing logic to check whether a type is a valid property wrapper only worked for nominal types, not generic types. Also consider generic types, e.g. State.

rdar://101781129

…per types

The existing logic to check whether a type is a valid property wrapper only worked for nominal types, not generic types. Also consider generic types.
@ahoppen ahoppen marked this pull request as ready for review February 17, 2023 18:33
@ahoppen ahoppen requested a review from bnbarham February 17, 2023 18:33
@ahoppen
Copy link
Member Author

ahoppen commented Feb 17, 2023

@swift-ci Please smoke test

@@ -27,7 +27,7 @@ using TypeRelation = CodeCompletionResultTypeRelation;
/// Returns the kind of attributes \c Ty can be used as.
static OptionSet<CustomAttributeKind> getCustomAttributeKinds(Type Ty) {
OptionSet<CustomAttributeKind> Result;
if (auto NominalTy = Ty->getAs<NominalType>()) {
if (auto NominalTy = Ty->getAs<NominalOrBoundGenericNominalType>()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah that's unfortunate. Thanks for the quick fix!

@bnbarham
Copy link
Contributor

@swift-ci please smoke test Linux platform

@ahoppen ahoppen merged commit 24f64b8 into swiftlang:main Feb 21, 2023
@ahoppen ahoppen deleted the ahoppen/property-wrapper-relationship branch February 21, 2023 07:22
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.

3 participants