Skip to content

[Sema] Allow @_section/@_used in concrete generic contex #75277

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

Conversation

kastiglione
Copy link
Contributor

@kastiglione kastiglione commented Jul 16, 2024

Allow @_section and @_used to be used in fully constrained extensions.

This aligns with the existing behavior of static properties of generic types. The following is valid:

extension Array where Element == Int {
    static let specificConstant = 41
}

However, adding @_section or @_used to the above property, will result in an error diagnostic.

This change updates the logic of @_section/@_used to allow their use when the generic context is fully concrete.

(cherry picked from commit ad8b0f3)

Allow `@_section` and `@_used` to be used in fully constrained extensions.

This aligns with the existing behavior of static properties of generic types. The following is valid:

```swift
extension Array where Element == Int {
  static let specificConstant = 41
}
```

However, adding `@_section` or `@_used` to the above property, will result in an error diagnostic.

This change updates the logic of `@_section`/`@_used` to allow their use when the generic context is fully concrete.

(cherry picked from commit ad8b0f3)
@kastiglione kastiglione requested a review from a team as a code owner July 16, 2024 21:18
@kastiglione kastiglione changed the title [stdlib][docs] Fix the SeeAlso documentation for withDiscardingTaskGroup [Sema] Allow @_section/@_used in concrete generic contex Jul 16, 2024
@kastiglione
Copy link
Contributor Author

@swift-ci test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

LGTM!

@kastiglione kastiglione merged commit fa753d7 into release/6.0 Jul 17, 2024
5 checks passed
@kastiglione kastiglione deleted the dl/Sema-Allow-_section-_used-in-concrete-generic-context-75222 branch July 17, 2024 20:47
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.

2 participants