psi2ir: Fix return insertion
We should only insert a return statement at the end of a lambda or function if the final statement is used as an expression (slice USED_AS_RESULT_OF_LAMBDA and USED_AS_EXPRESSION).
This commit is contained in:
committed by
Dmitry Petrov
parent
b3e733ea4f
commit
0da4b06074
@@ -1286,6 +1286,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
|
||||
runTest("compiler/testData/ir/irText/expressions/whenReturn.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("whenReturnUnit.kt")
|
||||
public void testWhenReturnUnit() throws Exception {
|
||||
runTest("compiler/testData/ir/irText/expressions/whenReturnUnit.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("whenUnusedExpression.kt")
|
||||
public void testWhenUnusedExpression() throws Exception {
|
||||
runTest("compiler/testData/ir/irText/expressions/whenUnusedExpression.kt");
|
||||
|
||||
Reference in New Issue
Block a user