google / google/google-java-format

Native version fails to format record patterns in switches if the first nested pattern is final

オープン
#1,257 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
6.2k
フォーク
937
平均マージ
6分
マージ済み PR(30日)
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。