Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear error messages for invisible whitespace #954

Open
ayyess opened this issue Jul 31, 2023 · 0 comments
Open

Unclear error messages for invisible whitespace #954

ayyess opened this issue Jul 31, 2023 · 0 comments
Labels

Comments

@ayyess
Copy link

ayyess commented Jul 31, 2023

The following program with a zero width space after the println is executable but cannot not be formatted

public class Main {
    public static void main(String[] args) {
        System.out.println​("hello");
    }
}
% java -version
openjdk version "19.0.1" 2022-10-18
OpenJDK Runtime Environment Zulu19.30+11-CA (build 19.0.1+10)
OpenJDK 64-Bit Server VM Zulu19.30+11-CA (build 19.0.1+10, mixed mode, sharing)
% javac Main.java
% java Main
hello
% google-java-format --version
google-java-format: Version 1.17.0
% google-java-format Main.java
Main.java:3:10: error: expected token: 'println'; generated println instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants