Skip to content

kotlin: branch rule counts 'return' — inconsistent with java/swift/c siblings #2545

Closed

Description

@squid-protocol

Summary

Design question from the #1096 control corpus: kotlin's branch rule counts return. Every kotlin function contributes its returns to branch mass — the corpus's 3-planted-branch file records 8 (5 returns + if/else/when), and files with zero branch keywords record branch 3 from returns alone.

Question

Assembly counting call/ret as control transfers is defensible bare-metal morphology (ledgered, not filed). Kotlin counting return while java/swift/c/etc do not looks like an inconsistency rather than a decision — it makes kotlin structurally "hotter" than identical java in cross-language comparison.

If deliberate (early-return complexity signal?), a doc note settles it; if not, dropping return from the kotlin branch alternation aligns it with its siblings.

References

#1096 corpus ledger kotlin-return-in-branch; data/kotlin/expected_signals.json.

Activity

  1. squid-protocol commented on Aug 31, 2026

    @squid-protocol
    OwnerAuthor

    Batch-4 addendum: return-counts-as-branch is a 5-language family, not a kotlin quirk — apex, objective-c, powershell, and zig (pattern-confirmed: ...|try|catch|orelse|break|continue|return)) all count return, while java/swift/c/scala/dart/groovy do not. Whichever way the design question resolves, the split is currently arbitrary across siblings. Corpus evidence in each language's expected_signals.json.

  2. added
    bugUnintended behavior or logic failure in the engine
    metricsHeuristics, risk exposures, and topological math updates
    on Sep 1, 2026
  3. squid-protocol commented on Sep 1, 2026

    @squid-protocol
    OwnerAuthor

    Both halves merged and re-baselined: engine (#2634 — return removed from branch in kotlin/apex/objective-c/powershell/solidity/zig, relocated to structural_boundaries for the 2 languages that had no other rule tracking it) and corpus (keyword-rosetta#19 — all 6 languages' branch now matches planted intent, apex's state_mutation flux-weighting ripple confirmed and re-baselined). KEYWORD_ROSETTA_REF bumped, rosetta-audit dispatched on main against the new pin. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginemetricsHeuristics, risk exposures, and topological math updates

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions