mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The changes in https://github.com/apple/swift/pull/72410 caused a regression when checking availability in the following example: ``` // warning: Setter for 'hasDeprecatedSetter' is deprecated: ... x[y.hasDeprecatedSetter] = ... ``` The result of `y.hasDeprecatedSetter` is being passed as an argument to the subscript and its setter will not be called. To fix this, `ExprAvailabilityWalker` now consistently creates a new default `MemberAccessContext` when descending into any `Argument`, since the access context for the expressions surrounding the call should not affect the arguments to the call. Additionally, `MemberAccessContext` has been refactored to better model context state transitions. Instead of only modeling which accessors will be called, the enumeration's members now reflect the possible states that `ExprAvailabilityWalker` can be in during its traversal. This should hopefully make it easier to follow the logic for traversal of `LoadExpr`s and arguments. Resolves rdar://130487998.
33 KiB
33 KiB