[FIR] Analyze all statements in block except last one in independent mode

Some broken tests will be fixed in next commit
#KT-37176 Fixed
This commit is contained in:
Dmitriy Novozhilov
2020-03-04 14:10:18 +03:00
parent 1c728e8184
commit 770dfb69ba
23 changed files with 252 additions and 174 deletions
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// FULL_JDK
// WITH_RUNTIME
// TARGET_BACKEND: JVM
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
lateinit var ok: String
run {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
lateinit var ok: String
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
@@ -14,9 +14,9 @@ fun test() {
val x5: (Double) -> Unit = baz(id(<!UNRESOLVED_REFERENCE!>::foo<!>), id(id(<!UNRESOLVED_REFERENCE!>::foo<!>)))
id<(Int) -> Unit>(id(id(<!UNRESOLVED_REFERENCE!>::foo<!>)))
id<(Int) -> Unit>(id(id(::foo)))
id(id<(Int) -> Unit>(::foo))
baz<(Int) -> Unit>(id(<!UNRESOLVED_REFERENCE!>::foo<!>), id(id(<!UNRESOLVED_REFERENCE!>::foo<!>)))
baz(id(<!UNRESOLVED_REFERENCE!>::foo<!>), id(id<(Int) -> Unit>(::foo)))
baz<(Int) -> Unit>(id(::foo), id(id(::foo)))
baz(id(::foo), id(id<(Int) -> Unit>(::foo)))
baz(id(<!UNRESOLVED_REFERENCE!>::foo<!>), id<(Int) -> Unit>(id(::foo)))
}
@@ -22,7 +22,7 @@ FILE fqName:<root> fileName:/useNextParamInLambda.kt
BLOCK_BODY
VAR name:result type:kotlin.String [var]
CONST String type=kotlin.String value="fail"
TRY type=kotlin.String
TRY type=kotlin.Any
try: CALL 'public final fun f (f1: kotlin.Function0<kotlin.String>, f2: kotlin.Function0<kotlin.String>): kotlin.String declared in <root>' type=kotlin.String origin=null
CATCH parameter=val e: java.lang.Exception [val] declared in <root>.box
VAR name:e type:java.lang.Exception [val]
+2 -2
View File
@@ -24,7 +24,7 @@ FILE fqName:<root> fileName:/ifElseIf.kt
FUN name:testEmptyBranches1 visibility:public modality:FINAL <> (flag:kotlin.Boolean) returnType:kotlin.Unit
VALUE_PARAMETER name:flag index:0 type:kotlin.Boolean
BLOCK_BODY
WHEN type=kotlin.Unit origin=IF
WHEN type=kotlin.Any origin=IF
BRANCH
if: GET_VAR 'flag: kotlin.Boolean declared in <root>.testEmptyBranches1' type=kotlin.Boolean origin=null
then: BLOCK type=kotlin.Unit origin=null
@@ -38,7 +38,7 @@ FILE fqName:<root> fileName:/ifElseIf.kt
FUN name:testEmptyBranches2 visibility:public modality:FINAL <> (flag:kotlin.Boolean) returnType:kotlin.Unit
VALUE_PARAMETER name:flag index:0 type:kotlin.Boolean
BLOCK_BODY
WHEN type=kotlin.Unit origin=IF
WHEN type=kotlin.Any origin=IF
BRANCH
if: GET_VAR 'flag: kotlin.Boolean declared in <root>.testEmptyBranches2' type=kotlin.Boolean origin=null
then: BLOCK type=kotlin.Unit origin=null