Java Type Migration: warn on enum constant when the argument type can't be converted (IDEA-314701)

GitOrigin-RevId: c5f8a21262476077e456f6bf99c05622ba8c0006
This commit is contained in:
Bas Leijdekkers
2023-03-04 20:32:01 +01:00
committed by intellij-monorepo-bot
parent 19cf134f75
commit a0e8b31187
5 changed files with 25 additions and 4 deletions

View File

@@ -48,6 +48,10 @@ public class TypeMigrationTest extends TypeMigrationTestBase {
doTestFirstParamType("x", PsiTypes.longType());
}
public void testEnumConstant() {
doTestFirstParamType("Test", PsiTypes.byteType());
}
public void testVarargsAndBoxing() {
doTestFieldType("x", PsiTypes.longType());
}

View File

@@ -0,0 +1,8 @@
Types:
PsiParameter:i : byte
Conversions:
New expression type changes:
Fails:
1->byte

View File

@@ -0,0 +1,5 @@
enum Test {
A(1);
Test(byte i) {}
}

View File

@@ -0,0 +1,5 @@
enum Test {
A(1);
Test(int i) {}
}