mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Accessors no longer appear as members of their parent DeclContext
Accessors logically belong to their storage and can be synthesized on the fly, so removing them from the members list eliminates one source of mutability (but doesn't eliminate it; there are also witnesses for derived conformances, and implicit constructors). Since a few ASTWalker implementations break in non-trivial ways when the traversal is changed to visit accessors as children of the storage rather than peers, I hacked up the ASTWalker to optionally preserve the old traversal order for now. This is ugly and needs to be cleaned up, but I want to avoid breaking _too_ much with this commit.
This commit is contained in:
@@ -182,7 +182,6 @@ static ValueDecl *deriveProperty(DerivedConformance &derived, Type type,
|
||||
synthesizer(getterDecl);
|
||||
|
||||
auto *dc = cast<IterableDeclContext>(derived.ConformanceDecl);
|
||||
dc->addMember(getterDecl);
|
||||
dc->addMember(propDecl);
|
||||
dc->addMember(pbDecl);
|
||||
return propDecl;
|
||||
|
||||
Reference in New Issue
Block a user