)]}'
{
  "commit": "b2a09c6fc9ed906047adbd83671e07f8fc0c55b0",
  "tree": "49ce9f3597dddaac49c41d86500b95f5c9de5932",
  "parents": [
    "ea63129ffb0d4411a654aa7ae09d458c25eb4679"
  ],
  "author": {
    "name": "Alexey Belkov",
    "email": "alexey.belkov@jetbrains.com",
    "time": "Wed Jul 15 15:09:55 2026 +0400"
  },
  "committer": {
    "name": "Alexey Belkov",
    "email": "alexey.belkov@jetbrains.com",
    "time": "Wed Jul 15 17:37:11 2026 +0400"
  },
  "message": "[LL] Restore synthetic Enum.clone() for pre-2.1 standard libraries\n\nCommit 77b9415 removed `addCloneForEnumIfNeeded`, which the stub-based\ndeserializer used to inject a synthetic `Enum.clone()`. That removal is\ncorrect for modern standard libraries: since the built-ins were\nrewritten as `expect`/`actual` in Kotlin 2.1 (KT-65526), neither the\ncommon nor the non-JVM `kotlin.Enum` declares `clone()`, so injecting it\nproduced the false positives it was meant to prevent (KT-69726,\nKT-69727).\n\nStandard libraries built before 2.1, however, still lack `clone()` on\nthe non-JVM `kotlin.Enum` while their common `kotlin.Enum` exposes it.\nAgainst such a dependency, every `expect`/`actual` enum then reports a\nfalse-positive NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS for the missing\n`clone()` — the asymmetry originally worked around in KT-65417.\n\nRe-introduce the synthesis, gated on the klib compiler version of the\nlibrary that owns `kotlin.Enum`: synthesize `clone()` only when that\nversion is below 2.1.0. A per-declaration heuristic is impossible: the metadata\nformat has no \"actual class\" flag, so a 2.1 `actual class Enum` and a\nlegacy `class Enum` deserialize to identical stubs. JVM is unaffected —\nits `kotlin.Enum` comes from the bundled built-ins that already declare\n`clone()` (so the existing guard skips it), and its `.jar` root is never\nloaded as a klib.\n\nThe modern behavior stays covered by the existing `actualEnumCloneJs`\nsymbol test. The pre-2.1 branch is not exercised: the test\ninfrastructure has no versioned standard-library klib fixture.\nHowever, the fix has been verified manually in a KMP project\nwith a dependency on the 2.0 stdlib.\n\n^KT-65417\n^KT-69726\n^KT-69727\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6838cae3623b0d1f86b2499b4a8dc24718503970",
      "old_mode": 33188,
      "old_path": "analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/stubBased/deserialization/StubBasedClassDeserialization.kt",
      "new_id": "e746ea602f58dbc31f5509fa731e35d09f89def2",
      "new_mode": 33188,
      "new_path": "analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/stubBased/deserialization/StubBasedClassDeserialization.kt"
    }
  ]
}
