Files
kotlin-fork/analysis/low-level-api-fir/testData/getOrBuildFir/calls/arrayAssignOperatorAsSingleExpressionInIf.txt
T
Roman Golyshev b765cf3f99 KT-66411 [AA] Add fake source kind for single expression block around array assignments
A wrapper block was introduced as a part of fixing KT-59748, but was
assigned a real source, which had `getOrBuildFir` confused because
of the incorrectly built `KtToFirMapping`

It is relevant for:
- `if`, `when` expressions with an assignment as a single expression
- Kotlin code fragments,
when the assignment is being analysed as a single expression
in the fragment

^KT-66411 Fixed
2024-03-10 15:35:47 +00:00

31 lines
1.0 KiB
Plaintext
Vendored

KT element: KtBinaryExpression
FIR element: FirFunctionCallImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
R|<local>/foo|.R|/Foo.set|(Int(10), String())
FIR FILE:
FILE: [ResolvedTo(IMPORTS)] arrayAssignOperatorAsSingleExpressionInIf.kt
public final [ResolvedTo(STATUS)] class Foo : R|kotlin/Any| {
public [ResolvedTo(STATUS)] [ContainingClassKey=Foo] constructor(): R|Foo| {
LAZY_super<R|kotlin/Any|>
}
public final operator [ResolvedTo(CONTRACTS)] fun set([ResolvedTo(CONTRACTS)] n: R|kotlin/Int|, [ResolvedTo(CONTRACTS)] value: R|kotlin/String|): R|kotlin/Unit| {
}
}
public final [ResolvedTo(BODY_RESOLVE)] fun usageFoo([ResolvedTo(BODY_RESOLVE)] flag: R|kotlin/Boolean|, [ResolvedTo(BODY_RESOLVE)] foo: R|Foo|): R|kotlin/Unit| {
when () {
R|<local>/flag| -> {
{
R|<local>/foo|.R|/Foo.set|(Int(10), String())
Unit
}
}
}
}