Files
kotlin-fork/analysis/low-level-api-fir/testData/getOrBuildFir/calls/setOperatorScript.txt
T
vladislav.grechko 9aa8fb80e7 Set correct IR origins for inc/dec operations
NB: in order to produce correct IR origins, the source element kinds for
some FIR elements has been changed. As a side effect, mapping PSI to FIR
slightly changed: namely, for `a[b]++`, `a[b]` used to be mapped on
`set` call or callable reference, but now it is mapped on `get` call.

^KT-61891: Fixed
^KT-64387: Fixed
2024-01-30 14:26:10 +00:00

48 lines
2.2 KiB
Plaintext
Vendored

KT element: KtArrayAccessExpression
FIR element: FirFunctionCallImpl
FIR source kind: DesugaredPostfixInc
FIR element rendered:
R|<local>/<array>|.R|test/B.get|(R|<local>/<index_0>|)
FIR FILE:
FILE: [ResolvedTo(IMPORTS)] setOperatorScript.kts
package test
context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: [ResolvedTo(BODY_RESOLVE)] <script-setOperatorScript.kts>
[ResolvedTo(BODY_RESOLVE)] lval args: R|kotlin/Array<kotlin/String>|
public final [ResolvedTo(STATUS)] class B : R|kotlin/Any| {
public [ResolvedTo(STATUS)] [ContainingClassKey=B] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=test/B.n] n: R|kotlin/Int|): R|test/B| {
LAZY_super<R|kotlin/Any|>
}
public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val n: R|kotlin/Int| = R|<local>/n|
public [ResolvedTo(STATUS)] [ContainingClassKey=B] get(): R|kotlin/Int|
public final operator [ResolvedTo(CONTRACTS)] fun set([ResolvedTo(CONTRACTS)] i: R|kotlin/Int|, [ResolvedTo(CONTRACTS)] a: R|test/B|): R|kotlin/Unit| {
}
public final operator [ResolvedTo(CONTRACTS)] fun get([ResolvedTo(CONTRACTS)] i: R|kotlin/Int|): R|test/B| {
}
public final operator [ResolvedTo(CONTRACTS)] fun inc(): R|test/B| {
}
}
public final [ResolvedTo(BODY_RESOLVE)] var a: R|test/B| = R|test/B.B|(Int(1))
public [ResolvedTo(BODY_RESOLVE)] get(): R|test/B|
public [ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] value: R|test/B|): R|kotlin/Unit|
public final [ResolvedTo(BODY_RESOLVE)] val $$result: R|test/B| = {
[ResolvedTo(BODY_RESOLVE)] lval <array>: R|test/B| = R|test/a|
[ResolvedTo(BODY_RESOLVE)] lval <index_0>: R|kotlin/Int| = Int(2)
[ResolvedTo(BODY_RESOLVE)] lval <unary>: R|test/B| = R|<local>/<array>|.R|test/B.get|(R|<local>/<index_0>|)
R|<local>/<array>|.R|test/B.set|(R|<local>/<index_0>|, R|<local>/<unary>|.R|test/B.inc|())
R|<local>/<unary>|
}
public [ResolvedTo(BODY_RESOLVE)] get(): R|test/B|