[FIR] Don't assume that exit lambda node is target for exceptional exit for inplace lambdas
#KT-39709 Fixed #KT-43156 Fixed
This commit is contained in:
committed by
teamcityserver
parent
440cf78884
commit
87380d1913
+2
-2
@@ -30,7 +30,7 @@ fun innerTryCatchInitializes() {
|
||||
}
|
||||
}
|
||||
// Can get here only when inlined lambda exited properly, i.e. x is initialized
|
||||
<!UNINITIALIZED_VARIABLE!>x<!>.inc()
|
||||
x.inc()
|
||||
outerComputation()
|
||||
|
||||
} catch (e: java.lang.Exception) {
|
||||
@@ -44,4 +44,4 @@ fun innerTryCatchInitializes() {
|
||||
}
|
||||
// Here x=I because outer try-catch either exited normally (x=I) or catched exception (x=I, with reassingment, though)
|
||||
x.inc()
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ fun throwIfNotCalled() {
|
||||
}
|
||||
// x *is* initialized here, because if myRun was never called -> exception
|
||||
// were thrown and control flow wouldn't be here
|
||||
println(<!UNINITIALIZED_VARIABLE!>x<!>)
|
||||
println(x)
|
||||
}
|
||||
|
||||
fun catchThrowIfNotCalled() {
|
||||
@@ -45,4 +45,4 @@ fun catchThrowIfNotCalled() {
|
||||
|
||||
// x *isn't* initialized here!
|
||||
println(<!UNINITIALIZED_VARIABLE!>x<!>)
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -43,7 +43,7 @@ fun possibleReassignmentInTryCatch() {
|
||||
}
|
||||
x.inc()
|
||||
}
|
||||
<!UNINITIALIZED_VARIABLE!>x<!>.inc()
|
||||
x.inc()
|
||||
}
|
||||
|
||||
fun tryCatchOuter() {
|
||||
|
||||
Reference in New Issue
Block a user