Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolveWithStdlib/components.fir.txt
T
Kirill Rakhman 8de36c416e [RAW FIR] Put destructuring statements outside of main lambda block
This fixes a false positive REDECLARATION when you want to shadow
a destructured lambda parameter inside the lambda.

#KT-60771 Fixed
2023-08-24 11:07:45 +00:00

48 lines
2.0 KiB
Plaintext
Vendored

FILE: components.kt
public final data class D : R|kotlin/Any| {
public constructor(x: R|kotlin/Int|, y: R|kotlin/String|): R|D| {
super<R|kotlin/Any|>()
}
public final val x: R|kotlin/Int| = R|<local>/x|
public get(): R|kotlin/Int|
public final val y: R|kotlin/String| = R|<local>/y|
public get(): R|kotlin/String|
public final operator fun component1(): R|kotlin/Int|
public final operator fun component2(): R|kotlin/String|
public final fun copy(x: R|kotlin/Int| = this@R|/D|.R|/D.x|, y: R|kotlin/String| = this@R|/D|.R|/D.y|): R|D|
}
public final fun foo(list: R|kotlin/collections/List<D>|): R|kotlin/Unit| {
{
lval <iterator>: R|kotlin/collections/Iterator<D>| = R|<local>/list|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<D>|>|()
while(R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.hasNext: R|kotlin/Boolean|>|()) {
lval <destruct>: R|D| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|D|>|()
lval x: R|kotlin/Int| = R|<local>/<destruct>|.R|/D.component1|()
lval y: R|kotlin/String| = R|<local>/<destruct>|.R|/D.component2|()
{
}
}
}
lval <destruct>: R|D| = R|<local>/list|.R|kotlin/collections/first|<R|D|>()
lval x: R|kotlin/Int| = R|<local>/<destruct>|.R|/D.component1|()
lval y: R|kotlin/String| = R|<local>/<destruct>|.R|/D.component2|()
R|<local>/list|.R|kotlin/collections/forEach|<R|D|>(<L> = forEach@fun <anonymous>(<destruct>: R|D|): R|kotlin/Unit| <inline=Inline, kind=UNKNOWN> {
lval x: R|kotlin/Int| = R|<local>/<destruct>|.R|/D.component1|()
lval y: R|kotlin/String| = R|<local>/<destruct>|.R|/D.component2|()
{
R|kotlin/io/println|(R|<local>/x|)
R|kotlin/io/println|(R|<local>/y|)
}
}
)
}