FIR IDE: introduce KtFirArrayAccessReference

This commit is contained in:
Ilya Kirillov
2020-07-13 15:28:11 +03:00
parent 22054c8507
commit 0870ded054
10 changed files with 108 additions and 4 deletions
@@ -1790,16 +1790,17 @@ class RawFirBuilder(
if (getArgument != null) {
calleeReference = buildSimpleNamedReference {
source = expression.parent.toFirSourceElement()
this.source = source
this.source = source.fakeElement(FirFakeSourceElementKind.ArrayAccessNameReference)
name = OperatorNameConventions.SET
}
} else {
source = expression.toFirSourceElement()
calleeReference = buildSimpleNamedReference {
this.source = source
this.source = source.fakeElement(FirFakeSourceElementKind.ArrayAccessNameReference)
name = OperatorNameConventions.GET
}
}
this.source = source
explicitReceiver = arrayExpression.toFirExpression("No array expression")
argumentList = buildArgumentList {
for (indexExpression in expression.indexExpressions) {
@@ -139,6 +139,9 @@ sealed class FirFakeSourceElementKind : FirSourceElementKind() {
// where `val $subj = a` has a fake source
object WhenGeneratedSubject : FirFakeSourceElementKind()
// list[0] -> list.get(0) where name reference will have a fake source element
object ArrayAccessNameReference : FirFakeSourceElementKind()
// super.foo() --> super<Supertype>.foo()
// where `Supertype` has a fake source
object SuperCallImplicitType : FirFakeSourceElementKind()