[FIR] Remove implicit coercion of ifs and whens to Unit
The rule of thumb is the following: If the `if` and `when` can be successfully replaced with `while`, then it is used as a statement, otherwise, it is used as an expression. #KT-59883
This commit is contained in:
committed by
Space Team
parent
2e66954d01
commit
931f2eab58
+6
@@ -8062,6 +8062,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/throwInLambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tryCatchFinallyIfs.kt")
|
||||
public void testTryCatchFinallyIfs() {
|
||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/tryCatchFinallyIfs.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tryWithAssignmentUsedInCatch.kt")
|
||||
public void testTryWithAssignmentUsedInCatch() {
|
||||
|
||||
+6
@@ -8062,6 +8062,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/throwInLambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tryCatchFinallyIfs.kt")
|
||||
public void testTryCatchFinallyIfs() {
|
||||
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/tryCatchFinallyIfs.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tryWithAssignmentUsedInCatch.kt")
|
||||
public void testTryWithAssignmentUsedInCatch() {
|
||||
|
||||
Reference in New Issue
Block a user