diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index 98636041c30..cf35a690643 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -31001,6 +31001,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt"); } + @Test + @TestMetadata("ExhaustivePlatformBoolean.kt") + public void testExhaustivePlatformBoolean() throws Exception { + runTest("compiler/testData/diagnostics/tests/when/ExhaustivePlatformBoolean.kt"); + } + @Test @TestMetadata("ExhaustivePlatformEnum.kt") public void testExhaustivePlatformEnum() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java index 7e28aa7cc29..d02fbbc9ddd 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java @@ -31001,6 +31001,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt"); } + @Test + @TestMetadata("ExhaustivePlatformBoolean.kt") + public void testExhaustivePlatformBoolean() throws Exception { + runTest("compiler/testData/diagnostics/tests/when/ExhaustivePlatformBoolean.kt"); + } + @Test @TestMetadata("ExhaustivePlatformEnum.kt") public void testExhaustivePlatformEnum() throws Exception { diff --git a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformBoolean.kt b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformBoolean.kt new file mode 100644 index 00000000000..bf25b13cf95 --- /dev/null +++ b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformBoolean.kt @@ -0,0 +1,21 @@ +// FIR_IDENTICAL +// FILE: Provider.java + +public class Provider { + public static Boolean getCondition() { + return null; + } +} + +// FILE: main.kt + +fun test_1(): Int = when (Provider.getCondition()) { + true -> 1 + false -> 2 +} + +fun test_2(): Int = when (Provider.getCondition()) { + true -> 1 + false -> 2 + null -> 3 +} diff --git a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformBoolean.txt b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformBoolean.txt new file mode 100644 index 00000000000..1662510119c --- /dev/null +++ b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformBoolean.txt @@ -0,0 +1,14 @@ +package + +public fun test_1(): kotlin.Int +public fun test_2(): kotlin.Int + +public open class Provider { + public constructor Provider() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + // Static members + public open fun getCondition(): kotlin.Boolean! +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 8a197022733..8b68ca3abbf 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -31097,6 +31097,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt"); } + @Test + @TestMetadata("ExhaustivePlatformBoolean.kt") + public void testExhaustivePlatformBoolean() throws Exception { + runTest("compiler/testData/diagnostics/tests/when/ExhaustivePlatformBoolean.kt"); + } + @Test @TestMetadata("ExhaustivePlatformEnum.kt") public void testExhaustivePlatformEnum() throws Exception { diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java index d9e13138229..a7cbd846057 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java @@ -31001,6 +31001,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag runTest("compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt"); } + @Test + @TestMetadata("ExhaustivePlatformBoolean.kt") + public void testExhaustivePlatformBoolean() throws Exception { + runTest("compiler/testData/diagnostics/tests/when/ExhaustivePlatformBoolean.kt"); + } + @Test @TestMetadata("ExhaustivePlatformEnum.kt") public void testExhaustivePlatformEnum() throws Exception {