Skip to content

Sema: Always allow method overrides to be as available as the context #78937

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

tshortli
Copy link
Contributor

When a method override is as available as the class it's a member of, then it can't be any more available. It doesn't make sense to diagnose such a method as less available than the method it overrides. This regressed recently for methods belonging to classes that are nested inside extensions. The availability of the derived class may be defined by its context, but the compiler was only checking the availability attributes directly on the class.

Resolves rdar://143600638.

When a method override is as available as the class it's a member of, then it
can't be any more available. It doesn't make sense to diagnose such a method as
less available than the method it overrides. This regressed recently for
methods belonging to classes that are nested inside extensions. The
availability of the derived class may be defined by its context, but the
compiler was only checking the availability attributes directly on the class.

Resolves rdar://143600638.
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli enabled auto-merge January 27, 2025 17:21
@tshortli tshortli merged commit 45b5050 into swiftlang:main Jan 27, 2025
5 checks passed
@tshortli tshortli deleted the allow-overrides-as-available-as-their-context branch January 27, 2025 22:49
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.

1 participant