mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ParseableInterface] Go through pattern binding for all variables with storage
Instead of only printing through the pattern binding, and potentially missing stored properties with property observers, defer to the pattern binding for all stored properties, and print accessors if applicable while printing pattern bindings.
This commit is contained in:
@@ -3230,7 +3230,7 @@ bool Decl::shouldPrintInContext(const PrintOptions &PO) const {
|
||||
// Stored variables in Swift source will be picked up by the
|
||||
// PatternBindingDecl.
|
||||
if (auto *VD = dyn_cast<VarDecl>(this)) {
|
||||
if (!VD->hasClangNode() && VD->getImplInfo().isSimpleStored())
|
||||
if (!VD->hasClangNode() && VD->hasStorage())
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3241,7 +3241,7 @@ bool Decl::shouldPrintInContext(const PrintOptions &PO) const {
|
||||
auto pattern =
|
||||
pbd->getPatternList()[0].getPattern()->getSemanticsProvidingPattern();
|
||||
if (auto named = dyn_cast<NamedPattern>(pattern)) {
|
||||
if (!named->getDecl()->getImplInfo().isSimpleStored())
|
||||
if (!named->getDecl()->hasStorage())
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user