Java: add cast to single branch of conditional expression when possible (IDEA-358278)

GitOrigin-RevId: 8f3137172d8a1526da2228e3c9ed911f9805c16c
This commit is contained in:
Bas Leijdekkers
2024-08-26 14:42:49 +02:00
committed by intellij-monorepo-bot
parent 83bba063e7
commit 18cb209fa7
3 changed files with 17 additions and 5 deletions

View File

@@ -0,0 +1,7 @@
// "Cast expression to 'byte'" "true-preview"
class A {
void f(boolean v) {
int i = 10;
Byte b = v ? 100 : (byte) i;
}
}

View File

@@ -0,0 +1,7 @@
// "Cast expression to 'byte'" "true-preview"
class A {
void f(boolean v) {
int i = 10;
Byte b = <caret> v ? 100 : i;
}
}