Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

[TS] Invoke declared class getters during property reads

Aberta
#577 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
15/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
kotlin, typescript
Domínio
compilers, testing-qa

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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}.

Linguagem predominante
Kotlin
Estrelas
33
Forks
27
Merge médio
3d 21h
PRs com merge (30d)
88

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de UnitTestBot/usvm

Todas as issues de UnitTestBot/usvm

Issues semelhantes

Mais issues de Kotlin

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.