swift
a34a2d3c - Generalize AbstractStorageDecl::isSettable() to return a three-state value

Commit
1 year ago
Generalize AbstractStorageDecl::isSettable() to return a three-state value This operation determines whether a particular storage declaration, when accessed from a particular location, is mutable or not. It has a particular semantic that `let` declarations, when accessed from an initializer, are considered mutable even though they can only be assigned. There is similar logic for init accessors. Tease apart "truly mutable" from "initializable because we're in an initializer", introducing AbstractStorageDecl::mutability() to represent all three states. isSettable() remains available as a thin shim over mutability() and all clients are unchanged thus far, making this a no-op refactoring.
Author
Committer
Parents
Loading