diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index b449105110a..05fc49391c2 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -15348,6 +15348,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/enum/javaEnumValueOf.kt"); } + @Test + @TestMetadata("javaEnumValueOf2.kt") + public void testJavaEnumValueOf2() throws Exception { + runTest("compiler/testData/codegen/box/enum/javaEnumValueOf2.kt"); + } + @Test @TestMetadata("javaEnumValues.kt") public void testJavaEnumValues() throws Exception { diff --git a/compiler/testData/codegen/box/enum/javaEnumValueOf2.kt b/compiler/testData/codegen/box/enum/javaEnumValueOf2.kt new file mode 100644 index 00000000000..61023faee87 --- /dev/null +++ b/compiler/testData/codegen/box/enum/javaEnumValueOf2.kt @@ -0,0 +1,21 @@ +// TARGET_BACKEND: JVM +// MODULE: m1 +// FILE: E.java +public enum E { + OK(); + public static E valueOf(int x) { + if (x == 0) return OK; + return null; + } +} + +// MODULE: m2(m1) +// FILE: test.kt + +fun box(): String { + return doIt(E.valueOf(0)) +} + +fun doIt(e: E) = when (e) { + E.OK -> "OK" +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index ae450c5352f..dbe9e4b721e 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -15270,6 +15270,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/enum/javaEnumValueOf.kt"); } + @Test + @TestMetadata("javaEnumValueOf2.kt") + public void testJavaEnumValueOf2() throws Exception { + runTest("compiler/testData/codegen/box/enum/javaEnumValueOf2.kt"); + } + @Test @TestMetadata("javaEnumValues.kt") public void testJavaEnumValues() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index dea2da0dff5..61c41c25c30 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -15348,6 +15348,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/enum/javaEnumValueOf.kt"); } + @Test + @TestMetadata("javaEnumValueOf2.kt") + public void testJavaEnumValueOf2() throws Exception { + runTest("compiler/testData/codegen/box/enum/javaEnumValueOf2.kt"); + } + @Test @TestMetadata("javaEnumValues.kt") public void testJavaEnumValues() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index d3efb6af2a6..480148eb594 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -12532,6 +12532,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/enum/javaEnumValueOf.kt"); } + @TestMetadata("javaEnumValueOf2.kt") + public void testJavaEnumValueOf2() throws Exception { + runTest("compiler/testData/codegen/box/enum/javaEnumValueOf2.kt"); + } + @TestMetadata("javaEnumValues.kt") public void testJavaEnumValues() throws Exception { runTest("compiler/testData/codegen/box/enum/javaEnumValues.kt"); diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java index ce86993d282..cf8b587673e 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java @@ -15526,6 +15526,12 @@ public class NativeExtBlackBoxTestGenerated extends AbstractNativeBlackBoxTest { runTest("compiler/testData/codegen/box/enum/javaEnumValueOf.kt"); } + @Test + @TestMetadata("javaEnumValueOf2.kt") + public void testJavaEnumValueOf2() throws Exception { + runTest("compiler/testData/codegen/box/enum/javaEnumValueOf2.kt"); + } + @Test @TestMetadata("javaEnumValues.kt") public void testJavaEnumValues() throws Exception {