FIR: fix atomic qualified acess sharing the same PSI with callee ref

Consider an atomic reference `i`, it's FIR representation is

- FirQualifiedAccessExpression
  - calleeReference : FirNamedReference

Currently, both of the above FIR elements uses the same PSI element as
the source. Such problems are not present with `this` or `super` because
we manually mark them as `ExplicitThisOrSuperReference`.

This change generalizes the previous `ExplicitThisOrSuperReference` as
`ReferenceInAtomicQualifiedAccess` and fixes it for more cases.
This commit is contained in:
Tianyu Geng
2021-06-24 16:45:13 -07:00
committed by Ivan Kochurkin
parent 3bc0eaff59
commit 45d31fdba2
10 changed files with 105 additions and 26 deletions
@@ -52,6 +52,7 @@ class FirDiagnosticsHandler(testServices: TestServices) : FirAnalysisHandler(tes
private val allowedKindsForDebugInfo = setOf(
FirRealSourceElementKind,
FirFakeSourceElementKind.DesugaredCompoundAssignment,
FirFakeSourceElementKind.ReferenceInAtomicQualifiedAccess,
)
}