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
@@ -1,4 +1,4 @@
|
||||
// IGNORE_BACKEND_MULTI_MODULE: JVM_IR
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
package builders
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
// IGNORE_BACKEND_MULTI_MODULE: JVM_IR
|
||||
|
||||
package builders
|
||||
|
||||
inline fun call(crossinline init: () -> Unit) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// IGNORE_BACKEND_MULTI_MODULE: JVM_IR
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
Reference in New Issue
Block a user