mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Macros] When a macro defines a getter or setter, remove didSet/willSet
As with the initial value of a property that is converted from a stored property to a computed property by an accessor macro, remove didSet/willSet. It is the macro's responsibility to incorporate their code or diagnose them. Fixes rdar://111101833.
This commit is contained in:
@@ -5238,6 +5238,8 @@ private:
|
||||
|
||||
void addOpaqueAccessor(AccessorDecl *accessor);
|
||||
|
||||
void removeAccessor(AccessorDecl *accessor);
|
||||
|
||||
private:
|
||||
MutableArrayRef<AccessorDecl *> getAccessorsBuffer() {
|
||||
return { getTrailingObjects<AccessorDecl*>(), NumAccessors };
|
||||
@@ -5401,6 +5403,11 @@ public:
|
||||
return {};
|
||||
}
|
||||
|
||||
void removeAccessor(AccessorDecl *accessor) {
|
||||
if (auto *info = Accessors.getPointer())
|
||||
return info->removeAccessor(accessor);
|
||||
}
|
||||
|
||||
/// This is the primary mechanism by which we can easily determine whether
|
||||
/// this storage decl has any effects.
|
||||
///
|
||||
@@ -8906,6 +8913,9 @@ const ParamDecl *getParameterAt(const ValueDecl *source, unsigned index);
|
||||
/// nullptr if the source does not have a parameter list.
|
||||
const ParamDecl *getParameterAt(const DeclContext *source, unsigned index);
|
||||
|
||||
StringRef getAccessorNameForDiagnostic(AccessorDecl *accessor, bool article);
|
||||
StringRef getAccessorNameForDiagnostic(AccessorKind accessorKind, bool article);
|
||||
|
||||
void simple_display(llvm::raw_ostream &out,
|
||||
OptionSet<NominalTypeDecl::LookupDirectFlags> options);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user