-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Indentation: false positives when switch expression is invocation target #11741
Comments
I also just noticed that the same thing happens when the switch is int result = switch (something) {
case CASE -> {
yield switch (somethingElse) {
case CASE -> 1;
default -> 2;
}
};
default -> 3;
} |
I have the same problem with nested switch and yield |
Having the same issue when using Checkstyle with Java 17 sources containing new switch expression constructs. |
On my work project we use JDK 17, and also faced with that problem with nested switch expressions. |
Voted for this issue. Switched to JDK 17 where the switch expression significantly improved and used widely. |
I am on it. |
…ession is invocation target
…ession is invocation target
…ession is invocation target
…ession is invocation target
…ession is invocation target
I have read check documentation: https://checkstyle.org/config_misc.html#Indentation
I have downloaded the latest checkstyle from: https://checkstyle.org/cmdline.html#Download_and_Run
I have executed the cli and showed it below, as cli describes the problem better than 1,000 words
The
main
method contains two switch expressions: the first is immediately used as a target of method invocation, the second does the same, but its value is first assigned to an intermediate variable.Indentation
reports errors for the first switch, but not the second. This is similar to #8929, which (I believe) fixed it for the second switch.The text was updated successfully, but these errors were encountered: