[Analysis API FIR] support generated temp properties
KTIJ-23492 (array index expression), KTIJ-23138 (inc/dec desugaring)
This commit is contained in:
+1
-1
@@ -810,7 +810,7 @@ abstract class BaseFirBuilder<T>(val baseSession: FirSession, val context: Conte
|
||||
val indexVariables = indices.mapIndexed { i, index ->
|
||||
generateTemporaryVariable(
|
||||
baseModuleData,
|
||||
index.toFirSourceElement(),
|
||||
index.toFirSourceElement(KtFakeSourceElementKind.ArrayIndexExpressionReference),
|
||||
name = SpecialNames.subscribeOperatorIndex(i),
|
||||
index.convert()
|
||||
).also { statements += it }
|
||||
|
||||
@@ -163,6 +163,11 @@ sealed class KtFakeSourceElementKind : KtSourceElementKind() {
|
||||
// list[0] -> list.get(0) where name reference will have a fake source element
|
||||
object ArrayAccessNameReference : KtFakeSourceElementKind()
|
||||
|
||||
// a[b]++
|
||||
// b -> val <index0> = b where b will have fake property
|
||||
object ArrayIndexExpressionReference : KtFakeSourceElementKind()
|
||||
|
||||
|
||||
// super.foo() --> super<Supertype>.foo()
|
||||
// where `Supertype` has a fake source
|
||||
object SuperCallImplicitType : KtFakeSourceElementKind()
|
||||
|
||||
Reference in New Issue
Block a user