Why this is needed:
- With Kotlin 2.0 analysis, some local-variable locations resolve to a wider
declaration span than before.
- The previous extractor logic used provider-based ranges that can cover type,
annotations, and modifiers, which shifts expected variable location facts.
- This caused parity drift in tests that expect the location to point at the
variable name token itself.
What this changes:
- Cache current source text per file during extraction.
- Derive variable-name offsets by scanning the declaration slice and locating
the declared identifier token.
- Emit local-variable declaration/expr locations from that identifier span,
with fallback to the previous provider when source offsets are unavailable.
This restores stable name-anchored variable locations under Kotlin 2.0.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Why this is needed:
- Under K2, top-level declarations from external binaries are attached directly
to IrExternalPackageFragment rather than to an IrClass file-class parent.
- That bypassed the normal class-source location path, so some external file-class
entities ended up without stable binary file locations.
- Missing/unstable locations caused drift in tests that depend on external file
class member resolution and location facts.
What this changes:
- Resolve binary paths from IrMemberWithContainerSource (JvmPackagePartSource)
via a dedicated getContainerSourceBinaryPath helper.
- In KotlinUsesExtractor, when extracting top-level external declarations,
attach file-class location from container-source binary path when available.
- Track external file classes whose locations were emitted to avoid duplicate
hasLocation facts.
This targets the K2 external file-class location gap (for example file_classes and
external-property-overloads parity).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Why this is needed:
- The dev wrapper persisted the selected version in .kotlinc_version, but only installed binaries when the selected version changed.
- After a clean working directory (which can remove .kotlinc_installed), the version file can still point at an already-selected compiler, causing forward execution to fail because the binary directory no longer exists.
What this changes:
- Make install() idempotent by returning early when install dir already exists.
- Call install() unconditionally from main() so the selected version is always materialised before forwarding.
- Keep explicit reinstall behaviour on version switches by removing the old install directory when selection changes.
This is an independent reliability fix and not tied to Kotlin 1.x test routing.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Update documentation to only claim support for 2.4.0x
* Python test code; remove newlines between imports.
* Sync comments between kotlin 1.8 and 1.9
* Update code comments to attach where actually relevant,
and improve comments on IrMemberAccessExpression<*>.extensionReceiverParameterIndex()
Mark the integration tests that require a Kotlin 1.x language version
with @pytest.mark.kotlin1 so CI can run them on a pinned pre-2.4
compiler (Kotlin 2.4 no longer accepts -language-version 1.9).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add the Kotlin 2.4.0 compiler plugin variant (component registrar,
IR compatibility shims, and version-specific utilities), bundle the
2.4.0 compiler dependencies, and update the build wiring, supported
version metadata and the too-new diagnostic bound.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>