Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[TS] Invoke declared class getters during property reads

Aperta
#577 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
15/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
kotlin, typescript

Direzione di ricerca

Start from the probe wrapper and cases/matrix/target.ts, then trace how a property read on new Matrix(...) is lowered in the TypeScript frontend and IR to see why get rows(), get cols() and get data() fall back to _rows, _cols and _data. Run the Matrix scenario and check that Matrix.get and Matrix.isValidIndex are entered as expected. Done means getter bodies are entered on property reads, with receiver, effects, exceptions and inheritance matching native execution.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Current delivery (2026-10-17)

Getter invocation remains unimplemented. Published #595 is a safety boundary, not completion of this issue's original acceptance.

  • #595 is open, not merged, at 371a4659321831999ecacb4835c90785b0a23af6, stacked on #578 at d6c770ca5154cb55d2f3207374d5d0aa615d4fd8. All 7 CI checks are green at that exact head. Its recorded local full TS run has 1786 tests: 1647 passed, 139 skipped, zero failures/errors; Detekt main/test passed.
  • EtsIR still does not identify class accessors separately from ordinary prototype methods. Allocated-instance reads and ambiguous writes to a method-like declaration without a real data field now stop explicitly. A prior write cannot fabricate an own value for a getter without a setter. Actual own data fields, ordinary/inherited calls, and the existing method-capture-order regression remain supported; a narrow signature proof preserves unambiguous ordinary-method writes.
  • The unchanged Matrix reproduction now exhausts with zero terminal states, the explicit rows accessor/method-value limitation, and no engine failure. It no longer silently produces undefined. The unchanged SegmentTree constructor/query control still returns symbolic/native 3.

Still required: preserve accessor kind through the frontend/IR and invoke the selected getter with its actual receiver, including effects, exceptions, and inherited lookup. Setter effects, unsupported accessor forms, and complete method-value semantics need their own correct handling; #595 does not implement them. Keep this issue open after the safety PR is reviewed/merged. The original source, mismatch evidence, and acceptance below are retained.

Original report and acceptance (retained verbatim)

The original Matrix class now reaches ordinary execution after UnitTestBot/jacodb#448, but a fixed ordinary access produces an unreported semantic mismatch. Found during #575, linked to the real-class two-phase PBT/USVM plan #345.

Exact source: the unchanged frozen cases/matrix/target.ts from pbt-large-class-rerun-20261016. SHA-256: 3c4f790554d52f6da1913e2d3826e04b3de45e6271bc11e3bb21c15b96d7396c. Probe wrapper:

import { Matrix } from './target';
export function scenario(): number {
    return new Matrix([[1, 2], [3, 4]]).get(1, 0);
}

USVM base e56cea501, official immutable JacoDB snapshot 0fac32c8c5 (full source commit 0fac32c8c511c6228c3d6897262dc0924635af44), plus narrow marker-aware consumer changes from #575. Native TypeScript execution returns 3. Symbolic execution returns one terminal TsUndefined, EXHAUSTED, engineFailed=false, unsupportedCall=false, and empty unsupportedPaths.

Observed entered statements by method: %dflt.scenario=23, Matrix.constructor=23, Matrix.%instInit=4, Matrix.get=11, Matrix.isValidIndex=13. The source defines get rows(), get cols(), and get data() backed by _rows, _cols, and _data; none of those getter bodies is entered. Property reads currently follow ordinary field storage and fail to invoke the declared accessor. This silently changes isValidIndex and consequently the return from get.

Bounded fix: preserve the declared getter identity through frontend/IR, invoke the getter with the actual receiver on property reads, and preserve getter effects, thrown exceptions, and inherited lookup. Preserve existing setter behavior and explicitly reject unsupported accessor forms. Do not treat the missing accessor as an ordinary missing field. A general Symbol implementation is outside this issue.

Validation should include a minimal class getter source regression plus native replay for receiver/effects/inheritance, and the unchanged Matrix scenario above. Evidence artifact in this task: pbt-computed-members-preflight-20261016/{source-hashes.json,comparison.json,symbolic-results.json,native-results.json}.

Lingua principale
Kotlin
Stelle
33
Fork
27
Merge medio
3g 21h
PR unite (30g)
88

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di UnitTestBot/usvm

Tutte le issue di UnitTestBot/usvm

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.