Skip to content

Implicit return in arrow functions not considered for expressionCase etc #271

Closed
@Gama11

Description

@Gama11

With default settings, this:

class Main {
	public static function main() {
		var f = () -> switch (false) {
			case true: 1;
			case false: 0;
		}
	}
}

is reformatted to:

class Main {
	public static function main() {
		var f = () -> switch (false) {
			case true:
				1;
			case false:
				0;
		}
	}
}

This doesn't happen if you add an explicit return before switch, so I guess the implicit return that arrow functions have simply isn't considered here. That means this should affect other expression* settings too, not just expressionCase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsamelinebroken same line formatting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions