[AA] handles FIR isUsedAsExpression for return within function block
For the following example:
```
fun foo(bar: Int) {
<expr>if (bar == 4) return "Four"
else return "Int"</expr>
}
```
AA FE1.0 `isUsedAsExpression` returns `false`.
Since the current AA FIR `isUsedAsExpression` returns `true` for the
above example, this commit fixes it.
This commit is contained in:
committed by
Ilya Kirillov
parent
b6481ed891
commit
c55efe62a3
+24
@@ -958,6 +958,18 @@ public class FirStandaloneNormalAnalysisSourceModuleIsUsedAsExpressionTestGenera
|
||||
runTest("analysis/analysis-api/testData/components/expressionInfoProvider/isUsedAsExpression/functionLiteralExtensionReceiverType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function_body_with_if.kt")
|
||||
public void testFunction_body_with_if() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/expressionInfoProvider/isUsedAsExpression/function_body_with_if.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function_equal_block_with_if.kt")
|
||||
public void testFunction_equal_block_with_if() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/expressionInfoProvider/isUsedAsExpression/function_equal_block_with_if.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ifBranches_unused.kt")
|
||||
public void testIfBranches_unused() throws Exception {
|
||||
@@ -1510,12 +1522,24 @@ public class FirStandaloneNormalAnalysisSourceModuleIsUsedAsExpressionTestGenera
|
||||
runTest("analysis/analysis-api/testData/components/expressionInfoProvider/isUsedAsExpression/return_implicit_unit.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("return_inside_if.kt")
|
||||
public void testReturn_inside_if() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/expressionInfoProvider/isUsedAsExpression/return_inside_if.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("return_value.kt")
|
||||
public void testReturn_value() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/expressionInfoProvider/isUsedAsExpression/return_value.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("return_with_if.kt")
|
||||
public void testReturn_with_if() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/expressionInfoProvider/isUsedAsExpression/return_with_if.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("run_block.kt")
|
||||
public void testRun_block() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user