Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/cfa/reassignOfNonLocalProperty_initializedProperties.fir.txt
T
Brian Norman 7db551c452 [FIR] Property accessors are not part of class initialization
When checking for class val property reassignment diagnostic, property
initializers should be treated as part of the class initialization.
However, property accessors should not. Previously, only the property
itself was checked for both of these situations and resulted in not
reporting diagnostic within property accessors.

#KT-59744 Fixed
2023-08-22 13:28:36 +00:00

75 lines
2.8 KiB
Plaintext
Vendored

FILE: reassignOfNonLocalProperty_initializedProperties.kt
public final val z: R|kotlin/String| = String(ok)
public get(): R|kotlin/String|
public final val R|Some|.y: R|kotlin/String|
public get(): R|kotlin/String| {
^ String(ok)
}
public final class Some : R|kotlin/Any| {
public constructor(): R|Some| {
super<R|kotlin/Any|>()
}
public final val x: R|kotlin/String| = String(ok)
public get(): R|kotlin/String|
init {
this@R|/Some|.R|/Some.x| = String(error)
this@R|/Some|.R|/y| = String(error)
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> {
this@R|special/anonymous|.R|/Some.x| = String(error)
this@R|special/anonymous|.R|/y| = String(error)
R|/z| = String(error)
^ String(hello)
}
)
public get(): R|kotlin/String|
public final var b: R|kotlin/String| = String(hello)
public get(): R|kotlin/String| {
this@R|/Some|.R|/Some.x| = String(error)
this@R|/Some|.R|/y| = String(error)
R|/z| = String(error)
^ this@R|/Some|.F|/Some.b|
}
public set(value: R|kotlin/String|): R|kotlin/Unit| {
this@R|/Some|.R|/Some.x| = R|<local>/value|
this@R|/Some|.R|/y| = R|<local>/value|
R|/z| = R|<local>/value|
this@R|/Some|.F|/Some.b| = R|<local>/value|
}
public final var c: R|kotlin/String|
public get(): R|kotlin/String| {
this@R|/Some|.R|/Some.x| = String(error)
this@R|/Some|.R|/y| = String(error)
R|/z| = String(error)
^ String(hello)
}
public set(value: R|kotlin/String|): R|kotlin/Unit| {
this@R|/Some|.R|/Some.x| = R|<local>/value|
this@R|/Some|.R|/y| = R|<local>/value|
R|/z| = R|<local>/value|
}
public final fun test_1(): R|kotlin/Unit| {
this@R|/Some|.R|/Some.x| = String(error)
this@R|/Some|.R|/y| = String(error)
R|/z| = String(error)
}
}
public final fun R|Some|.test_2(): R|kotlin/Unit| {
this@R|/test_2|.R|/Some.x| = String(error)
this@R|/test_2|.R|/y| = String(error)
R|/z| = String(error)
}
public final fun test_3(some: R|Some|): R|kotlin/Unit| {
R|<local>/some|.R|/Some.x| = String(error)
R|<local>/some|.R|/y| = String(error)
R|/z| = String(error)
}