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

Fix availability checking for stored properties and enum cases with associated values #36327

Merged
merged 3 commits into from
Mar 6, 2021

Commits on Mar 5, 2021

  1. Configuration menu
    Copy the full SHA
    0bcfd22 View commit details
    Browse the repository at this point in the history
  2. Sema: Allow @available on stored properties as long as its as new as …

    …the deployment target
    slavapestov committed Mar 5, 2021
    Configuration menu
    Copy the full SHA
    cb9c1f9 View commit details
    Browse the repository at this point in the history
  3. Sema: Ban potential unavailability on enum cases with associated values

    This cannot be supported for the same reasons struct and class stored
    properties with potential unavailability cannot be supported.
    
    It is possible that some users relied on this, because it worked in
    some cases where the type metadata for the potentially unavailable
    type was not actually needed for anything (eg, if the type was @Frozen
    and trivial, or a simple class reference). If this becomes an issue
    we can downgrade this to a warning.
    
    Note that just like the previous fix for stored properties, we do
    still allow writing an '@available' attribute on the enum element if
    the OS version is not any newer than the deployment target. This allows
    annotating APIs with the OS version where they were introduced.
    slavapestov committed Mar 5, 2021
    Configuration menu
    Copy the full SHA
    511ada4 View commit details
    Browse the repository at this point in the history