Files
kotlin-fork/analysis/low-level-api-fir/testData/getOrBuildFir/calls/setOperator.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

38 lines
1.6 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)] setOperator.kt
package test
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)] fun test(): R|kotlin/Unit| {
[ResolvedTo(BODY_RESOLVE)] lvar a: R|test/B| = R|test/B.B|(Int(1))
[ResolvedTo(BODY_RESOLVE)] lval <array>: R|test/B| = R|<local>/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>|
}