Commit Graph

5 Commits

Author SHA1 Message Date
Allan Shortlidge
4f021a05a1 Tests: Verify that public properties of public types may be annotated with @available for releases up to the current deployment target of the library, even with -target-min-inlining-version min specified.
Resolves rdar://91174092
2022-04-01 13:02:04 -07:00
Allan Shortlidge
093b8d32db [Sema] Emit an error for attempts to use @available on var declarations that have attached property wrappers. Availability is not supported on stored properties, and properties with property wrappers are stored properties with a layer of indirection. Also, add the same missing diagnostic for lazy vars.
Resolves rdar://82713248
2022-02-03 09:02:59 -08:00
Mishal Shah
22f61df98b Use %target-cpu in the tests to support running on Apple Silicon hardware 2021-04-08 23:26:18 -07:00
Slava Pestov
511ada4a50 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.
2021-03-05 18:03:05 -05:00
Slava Pestov
cb9c1f93ee Sema: Allow @available on stored properties as long as its as new as the deployment target 2021-03-05 18:03:05 -05:00