[kotlin] Add test showing that "Use property access syntax" inspection/intention is not proposed for Java enums

^KTIJ-33953 Fixed

GitOrigin-RevId: 80fad1a90a6748b00608dba798082550ec90a453
This commit is contained in:
Victoria.Petrakovich
2025-06-26 22:18:15 +00:00
committed by intellij-monorepo-bot
parent be10cfd4dd
commit a8589105b0
7 changed files with 49 additions and 0 deletions
@@ -8029,6 +8029,11 @@ public abstract class K2LocalInspectionTestGenerated extends AbstractK2LocalInsp
runTest("../../../idea/tests/testData/inspectionsLocal/usePropertyAccessSyntax/callableReferenceExpressions/dontReplaceCallableReferenceGetterIn1dot9.kt");
}
@TestMetadata("dontReplaceForEnum.kt")
public void testDontReplaceForEnum() throws Exception {
runTest("../../../idea/tests/testData/inspectionsLocal/usePropertyAccessSyntax/callableReferenceExpressions/dontReplaceForEnum.kt");
}
@TestMetadata("dontReplaceGetterNotBuiltInFunctionType.kt")
public void testDontReplaceGetterNotBuiltInFunctionType() throws Exception {
runTest("../../../idea/tests/testData/inspectionsLocal/usePropertyAccessSyntax/callableReferenceExpressions/dontReplaceGetterNotBuiltInFunctionType.kt");
@@ -18746,6 +18746,11 @@ public abstract class LocalInspectionTestGenerated extends AbstractLocalInspecti
runTest("testData/inspectionsLocal/usePropertyAccessSyntax/callableReferenceExpressions/dontReplaceCallableReferenceGetterIn1dot9.kt");
}
@TestMetadata("dontReplaceForEnum.kt")
public void testDontReplaceForEnum() throws Exception {
runTest("testData/inspectionsLocal/usePropertyAccessSyntax/callableReferenceExpressions/dontReplaceForEnum.kt");
}
@TestMetadata("dontReplaceGetterNotBuiltInFunctionType.kt")
public void testDontReplaceGetterNotBuiltInFunctionType() throws Exception {
runTest("testData/inspectionsLocal/usePropertyAccessSyntax/callableReferenceExpressions/dontReplaceGetterNotBuiltInFunctionType.kt");
@@ -18363,6 +18363,11 @@ public abstract class K1IntentionTestGenerated extends AbstractK1IntentionTest {
runTest("testData/intentions/usePropertyAccessSyntax/conflict2.kt");
}
@TestMetadata("dontReplaceForEnum.kt")
public void testDontReplaceForEnum() throws Exception {
runTest("testData/intentions/usePropertyAccessSyntax/dontReplaceForEnum.kt");
}
@TestMetadata("genericClassMethod.kt")
public void testGenericClassMethod() throws Exception {
runTest("testData/intentions/usePropertyAccessSyntax/genericClassMethod.kt");
@@ -0,0 +1,12 @@
public enum TestEnum {
TEST_ENUM_ENTRY("test enum entry");
private final String name;
TestEnum(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
@@ -0,0 +1,5 @@
// PROBLEM: none
fun main() {
val entry = TestEnum.TEST_ENUM_ENTRY
entry.<caret>getName()
}
@@ -0,0 +1,12 @@
public enum TestEnum {
TEST_ENUM_ENTRY("test enum entry");
private final String name;
TestEnum(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
@@ -0,0 +1,5 @@
// IS_APPLICABLE: false
fun main() {
val entry = TestEnum.TEST_ENUM_ENTRY
entry.<caret>getName()
}