[LL FIR] LLFirPhaseUpdater: add missing update for initializer body

This commit is contained in:
Dmitrii Gridin
2023-09-18 16:52:57 +02:00
committed by Space Team
parent 12dc6b1ebc
commit e5f0356e16
5 changed files with 12 additions and 10 deletions
@@ -34,6 +34,7 @@ internal object LLFirPhaseUpdater {
target.backingField?.accept(PhaseUpdatingTransformer, newPhase)
}
is FirAnonymousInitializer -> target.body?.accept(PhaseUpdatingTransformer, newPhase)
is FirScript -> {
target.parameters.forEach { it.accept(PhaseUpdatingTransformer, newPhase) }
for (statement in target.statements) {
@@ -5,9 +5,9 @@ FILE: [ResolvedTo(BODY_RESOLVE)] initBlock.kt
}
[ResolvedTo(BODY_RESOLVE)] init {
[ResolvedTo(RAW_FIR)] lval x: R|kotlin/Int| = Int(10)
local final [ResolvedTo(RAW_FIR)] class B : R|kotlin/Any| {
public [ResolvedTo(RAW_FIR)] constructor(): R|<local>/B| {
[ResolvedTo(BODY_RESOLVE)] lval x: R|kotlin/Int| = Int(10)
local final [ResolvedTo(BODY_RESOLVE)] class B : R|kotlin/Any| {
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|<local>/B| {
super<R|kotlin/Any|>()
}
@@ -9,9 +9,9 @@ FILE: [ResolvedTo(BODY_RESOLVE)] initBlockScript.kts
}
[ResolvedTo(BODY_RESOLVE)] init {
[ResolvedTo(RAW_FIR)] lval x: R|kotlin/Int| = Int(10)
local final [ResolvedTo(RAW_FIR)] class B : R|kotlin/Any| {
public [ResolvedTo(RAW_FIR)] constructor(): R|<local>/B| {
[ResolvedTo(BODY_RESOLVE)] lval x: R|kotlin/Int| = Int(10)
local final [ResolvedTo(BODY_RESOLVE)] class B : R|kotlin/Any| {
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|<local>/B| {
super<R|kotlin/Any|>()
}
@@ -20,3 +20,4 @@ FILE: [ResolvedTo(BODY_RESOLVE)] initBlockScript.kts
}
}
@@ -19,10 +19,10 @@ FILE: [ResolvedTo(IMPORTS)] argsFromInit.kts
}
[ResolvedTo(BODY_RESOLVE)] init {
<Unresolved name: foo>#(<L> = [ResolvedTo(RAW_FIR)] foo@fun <anonymous>(): R|kotlin/Int| <inline=Unknown> {
<Unresolved name: foo>#(<L> = [ResolvedTo(BODY_RESOLVE)] foo@fun <anonymous>(): R|kotlin/Int| <inline=Unknown> {
^ R|<local>/args|.R|SubstitutionOverride<kotlin/Array.size: R|kotlin/Int|>|
}
)
}
}
}
@@ -4,7 +4,7 @@ FIR source kind: KtRealSourceElementKind
FIR element rendered:
[ResolvedTo(BODY_RESOLVE)] init {
[ResolvedTo(RAW_FIR)] lval i: R|kotlin/Int| = Int(1)
[ResolvedTo(BODY_RESOLVE)] lval i: R|kotlin/Int| = Int(1)
}
FIR FILE:
@@ -24,7 +24,7 @@ FILE: [ResolvedTo(IMPORTS)] initializerConflict.kt
}
[ResolvedTo(BODY_RESOLVE)] init {
[ResolvedTo(RAW_FIR)] lval i: R|kotlin/Int| = Int(1)
[ResolvedTo(BODY_RESOLVE)] lval i: R|kotlin/Int| = Int(1)
}
}