Files
codegraph/codegraph-kernel
danusha2345 8c35774d63 fix(kotlin): close the remaining property-hook holes — init blocks, destructuring, own-line accessors
Three shapes the hook still swallowed after cf582f4/8b2e436. The first two are
outright losses: the code existed in the file and reached the graph nowhere.

    init { val cfg = load() }        // `load` vanished — only the block's
                                     // bare statements survived
    val (a, b) = makePair()          // `makePair` vanished, at class AND
                                     // file scope
    val x: Int                       // walked, but attributed to the
        get() = compute()            // enclosing CLASS, not to `x`

The first two mint no symbol of their own, so they are walked at the ENCLOSING
scope — an `init` block's calls belong to the class, exactly like the block's
other statements. The third is an accessor the grammar makes a following
SIBLING of the property rather than a child (same-line accessors nest, which
8b2e436 already covered); the property now claims its own-line accessors, and
the accessor branch skips what the property claimed. The skip re-derives the
property's kind instead of remembering it across nodes, so a destructured or
local declaration — which mints nothing and therefore claims nothing — keeps
falling through as before. No cross-node state in either arm.

The scope/kind decision moved into one function (`kotlinPropertyKind` /
`property_kind`) now that two branches need it.

Measured on the 113-file Android/Kotlin project, against upstream c65d56c:
0 lost refs, 0 re-attributed, +368 new. Kernel parity unchanged (99/113
byte-identical, same 14 grammar-deferred files as upstream).
2026-08-05 23:24:00 +03:00
..