We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ec72a0 commit 42ab561Copy full SHA for 42ab561
lib/AST/ASTPrinter.cpp
@@ -2108,10 +2108,11 @@ void PrintAST::visitPatternBindingDecl(PatternBindingDecl *decl) {
2108
}
2109
2110
2111
- // HACK: If we're just printing a single pattern and it has accessors,
2112
- // print the accessors here.
2113
- if (decl->getNumPatternEntries() == 1) {
2114
- printAccessors(vd);
+ // If we're just printing a single pattern and it has accessors,
+ // print the accessors here. It is an error to add accessors to a
+ // pattern binding with multiple entries.
+ if (auto var = decl->getSingleVar()) {
2115
+ printAccessors(var);
2116
2117
2118
0 commit comments