google / google/google-java-format
Native version fails to format record patterns in switches if the first nested pattern is final
未关闭
- 主要语言
- Java
- 星标
- 6.2k
- 派生
- 937
- 平均合并
- 6 分钟
- 30 天内合并 PR
- 3
描述
The following code fails to format when using the native version of the formatter. (The JVM version works fine.)
```java
class Main {
void test() {
switch (test) {
case Test(final var x, final var y) -> {}
}
}
}
```
On the other hand, both of these examples are accepted:
```java
class Main {
void test() {
switch (test) {
case Test(var x, final var y) -> {}
}
}
}
```
```java
class Main {
void test() {
if (test instanceof Test(final var x, final var y)) {}
}
}
```
Tested on version 1.27.0.
贡献指南
评估
这个 Issue 还没有评估数据。