Skip to content

Commit 402fa4e

Browse files
committed
Fix formatting of closures with no parameters
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
1 parent f6f3329 commit 402fa4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/compiler/src/main/java/script/formatter/Formatter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ public void visitNotExpression(NotExpression node) {
459459
@Override
460460
public void visitClosureExpression(ClosureExpression node) {
461461
append('{');
462-
if( node.getParameters() != null ) {
462+
if( node.getParameters() != null && node.getParameters().length > 0 ) {
463463
append(' ');
464464
visitParameters(node.getParameters());
465465
append(" ->");

0 commit comments

Comments
 (0)