Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[TS] Invoke declared class getters during property reads

Đang mở
#577 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
15/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
kotlin, typescript
Lĩnh vực
compilers, testing-qa

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Kotlin
Star
33
Fork
27
Merge trung bình
3 ngày 21 giờ
Pull request đã merge (30 ngày)
88

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của UnitTestBot/usvm

Tất cả issue của UnitTestBot/usvm

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.