FIR CFA: fix function locality check
This commit is contained in:
+6
@@ -18,6 +18,12 @@ FILE: reassignOfNonMemberProperty_lateInitialization.kt
|
||||
this@R|/Some|.R|/Some.x| = String(ok)
|
||||
this@R|/Some|.R|/Some.x| = String(error)
|
||||
this@R|/Some|.R|/z| = String(error)
|
||||
local final fun foo(): R|kotlin/Unit| {
|
||||
this@R|/Some|.R|/Some.x| = String(error)
|
||||
this@R|/Some|.R|/Some.y| = String(error)
|
||||
this@R|/Some|.R|/z| = String(error)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final val a: R|kotlin/String| = this@R|/Some|.R|kotlin/run|<R|Some|, R|kotlin/String|>(<L> = run@fun R|Some|.<anonymous>(): R|kotlin/String| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
|
||||
Vendored
+6
@@ -12,6 +12,12 @@ class Some {
|
||||
x = "ok"
|
||||
<!VAL_REASSIGNMENT!>x<!> = "error"
|
||||
<!VAL_REASSIGNMENT!>z<!> = "error"
|
||||
|
||||
fun foo() {
|
||||
<!CAPTURED_MEMBER_VAL_INITIALIZATION!>x<!> = "error" // VAL_REASSIGNMENT also ok (or even better?)
|
||||
<!CAPTURED_MEMBER_VAL_INITIALIZATION!>y<!> = "error"
|
||||
<!VAL_REASSIGNMENT!>z<!> = "error"
|
||||
}
|
||||
}
|
||||
|
||||
val a: String = run {
|
||||
|
||||
+1
-1
@@ -152,7 +152,7 @@ class ControlFlowGraphBuilder {
|
||||
else -> throw IllegalArgumentException("Unknown function: ${function.render()}")
|
||||
}
|
||||
|
||||
val localFunctionNode = runIf(function.symbol.callableId.isLocal && bodyBuildingMode) {
|
||||
val localFunctionNode = runIf(function is FirSimpleFunction && function.isLocal && bodyBuildingMode) {
|
||||
createLocalFunctionDeclarationNode(function).also { addNewSimpleNode(it) }
|
||||
}
|
||||
val enterNode = enterGraph(function, name, ControlFlowGraph.Kind.Function) {
|
||||
|
||||
Reference in New Issue
Block a user