Skip to content
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

Unnecessary error when declaring extension to type with @available annotation #61135

Open
NachoSoto opened this issue Sep 15, 2022 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis

Comments

@NachoSoto
Copy link
Contributor

NachoSoto commented Sep 15, 2022

Describe the bug
Declaring extensions to types probably should inherit the same availability as the type itself.

Steps To Reproduce
I expect the following code to compile with no issues:

@available(iOS 13.0, *)
class A {}

extension A {}

Expected behavior
The functions declared in the extension are only available on iOS 13.0 and forward without needing to duplicate the @available annotation.

Actual behavior

'A' is only available in application extensions for iOS 13.0 or newer
Add @available attribute to enclosing extension

Environment (please fill out the following information)

  • Swift: 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50)
  • OS: macOS 13.0
  • Xcode: 14.0 RC
@NachoSoto NachoSoto added the bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. label Sep 15, 2022
@theblixguy theblixguy added the type checker Area → compiler: Semantic analysis label Sep 15, 2022
@AnthonyLatsis AnthonyLatsis added the compiler The Swift compiler in itself label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

3 participants