ReadWriteAccessCheckerFirImpl class is ReadWriteAccessChecker
implementation for FIR. We register it for both stand-alone and test
analsys. It is used by KotlinFirReferenceContributor.kt to check the
synthetic Java property.
FirSimpleNameReference class handles the references to the Java
synthetic property. It causes an issue in `processReference(..)` method
of `MethodTextOccurrenceProcessor` when the property is used by
read/write. Since read/write has two results of the reference resolution
i.e., getter for read and setter for write, `ref.solve()` in the method
returns `null` because it uses `resolve()` method in
PsiPolyVariantReferenceBase that returns null when it has multiple
results. This commit separates FirSimpleNameReference objects for
read/write to fix the issue.
var p: String? = something
if (p != null) {
foo(
run { p = null; n() },
// This lambda executes strictly after the one above by CFG,
// but data flow for type inference comes from before the call
// so p would get smartcasted if not forbidden.
run { p.length; 123 }
)
}
The existing code does not set the list of bases that
FirLightInterfaceClassSymbol extends for "extendsList". It collects only
the set of interfaces for "extendsList" of FirLightInterfaceClassSymbol.
However, interfaces can "extend" other classes and/or interfaces, but
they cannot "implement" other interfaces. Therefore, we have to includes
all interfaces and classes that the child interface extends in
the "extendsList". Additionally, this commit adds `private fun
PsiClass.hasSuper(..): Boolean` to FirLightClassBase that returns
whether one of recursive super classes of the PsiClass is `baseClass`
or not. This commit lets `isInheritor()` method use
`PsiClass.hasSuper()`.
This commit adds a new key that will allow users to enhance their
debugging experience in suspending contexts when using the IR backend.
After the key is enabled, the following things are changed:
1. All variables in a suspending context are spilled regardless their
liveness.
2. Their LVT records are not shrunk.
3. ACONST_NULL is not spilled to dead variables.
#KT-48678 In progress
(cherry picked from commit 38d97d0621)