Skip to content

Lambdas with "final var" arguments result in error: did not generate token "final" #959

Closed
@bwRavencl

Description

@bwRavencl

Processing lambda functions with arguments declared with final var produces: error: did not generate token "final"

Example Code:

class Test {

    public void test() {
        new File(".").listFiles((final var dir, final var name) -> true);
    }
}
$ java -jar google-java-format-1.17.0-all-deps.jar Test.java
Test.java:4:41: error: did not generate token "final"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions