Add test for exhaustive when with subject of Boolean! type
This commit is contained in:
committed by
teamcityserver
parent
09994ee8ea
commit
8a2e0cedf9
+6
@@ -31001,6 +31001,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt");
|
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
|
@Test
|
||||||
@TestMetadata("ExhaustivePlatformEnum.kt")
|
@TestMetadata("ExhaustivePlatformEnum.kt")
|
||||||
public void testExhaustivePlatformEnum() throws Exception {
|
public void testExhaustivePlatformEnum() throws Exception {
|
||||||
|
|||||||
+6
@@ -31001,6 +31001,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
|||||||
runTest("compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt");
|
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
|
@Test
|
||||||
@TestMetadata("ExhaustivePlatformEnum.kt")
|
@TestMetadata("ExhaustivePlatformEnum.kt")
|
||||||
public void testExhaustivePlatformEnum() throws Exception {
|
public void testExhaustivePlatformEnum() throws Exception {
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
@@ -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!
|
||||||
|
}
|
||||||
Generated
+6
@@ -31097,6 +31097,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt");
|
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
|
@Test
|
||||||
@TestMetadata("ExhaustivePlatformEnum.kt")
|
@TestMetadata("ExhaustivePlatformEnum.kt")
|
||||||
public void testExhaustivePlatformEnum() throws Exception {
|
public void testExhaustivePlatformEnum() throws Exception {
|
||||||
|
|||||||
+6
@@ -31001,6 +31001,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt");
|
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
|
@Test
|
||||||
@TestMetadata("ExhaustivePlatformEnum.kt")
|
@TestMetadata("ExhaustivePlatformEnum.kt")
|
||||||
public void testExhaustivePlatformEnum() throws Exception {
|
public void testExhaustivePlatformEnum() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user