aboutsummaryrefslogtreecommitdiff
path: root/src/delombok/lombok
diff options
context:
space:
mode:
Diffstat (limited to 'src/delombok/lombok')
-rw-r--r--src/delombok/lombok/delombok/PrettyPrinter.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/delombok/lombok/delombok/PrettyPrinter.java b/src/delombok/lombok/delombok/PrettyPrinter.java
index 13836d77..b8b38da9 100644
--- a/src/delombok/lombok/delombok/PrettyPrinter.java
+++ b/src/delombok/lombok/delombok/PrettyPrinter.java
@@ -1253,7 +1253,14 @@ public class PrettyPrinter extends JCTree.Visitor {
@Override public void visitForeachLoop(JCEnhancedForLoop tree) {
aPrint("for (");
- printVarDefInline(tree.var);
+ JCTree varOrRecordPattern = readObject(tree, "varOrRecordPattern", null);
+ if (varOrRecordPattern instanceof JCVariableDecl) {
+ printVarDefInline((JCVariableDecl) varOrRecordPattern);
+ } else if (varOrRecordPattern != null) {
+ print(varOrRecordPattern);
+ } else {
+ printVarDefInline(tree.var);
+ }
print(" : ");
print(tree.expr);
print(") ");
@@ -1427,9 +1434,7 @@ public class PrettyPrinter extends JCTree.Visitor {
void printBindingPattern(JCTree tree) {
JCTree var = readObject(tree, "var", tree);
- print((JCExpression) readObject(var, "vartype", null));
- print(" ");
- print((Name) readObject(var, "name", null));
+ printVarDef0((JCVariableDecl) var);
}
void printDefaultCase(JCTree tree) {