microsoft / microsoft/TypeScript

Investigate decorator initialization order re: renames of classes

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

@RyanCavanaugh đang làm issue này rồi.

Từ ngày 20/8/2026.

  • #63929 của @copilot-swe-agent — đang mở
Needs Investigation
Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

> @copilot address the next CR comment and think hard about other edge cases

Investigated the CR comment on computed class-element names (`@dec class C { [C]() {} }`) and verified against real `tsc` (7.0.2, legacy decorators, ES2020/ES2022) using several variants: getter/setter computed names, a computed name with its own member decorator, a static property computed name, and a computed name inside a nested class within a method body. In every case, real `tsc` *does* substitute the class alias in computed class-member names (e.g. emits `[C_1.name]() {}`, not `[C.name]() {}`), including before the alias is actually assigned (this is a real, pre-existing bug/quirk in Strada's own emit, not something this PR should "fix"). I built `tsgo` and confirmed its output already matches `tsc`'s byte-for-byte for all these cases at the current `afb6df68` state.

So the CR suggestion to exclude computed class-element names from alias detection/substitution is incorrect — implementing it would make `tsgo` diverge from `tsc`. I made no code changes for this comment; current behavior is already correct.

_Originally posted by @Copilot in https://github.com/microsoft/typescript-go/issues/4650#issuecomment-5321088559_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Đánh giá

Issue này chưa được đánh giá.

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.