microsoft / microsoft/TypeScript

Wrong `super` in class element decorator

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

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

Từ ngày 21/2/2024.

Needs Investigation
Ngôn ngữ chính
Go
Star
111k
Fork
14.4k
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
117

Mô tả

🔎 Search Terms

super decorators

🕗 Version & Regression Information
  • This is the behavior in every version I tried
⏯ Playground Link

https://www.typescriptlang.org/play?target=99#code/MYGwhgzhAECC0FMAeAXBA7AJjUkYG9owAKAfQEYAuI9ATwBppSAmasOgSmkOAHt0IvEAgB0IXgHNiAIggBXAA4IATiLDSuAX2jb8AKGjQAZr17Eu+w4eEoiRtMugBeaOecA+bpoDcBq7ihoACFuPytoAAF5JVUwY2doaWlfcM09MLsHcxSdPTS9dAQAdzhzERMzDm8gA

💻 Code

I'm targeting ESNext

class A extends class { a(_1: any, _2: any) { console.log("super.a") } } {
  foo() {
    let after = () => {};
    class B {
      @super.a f = "";
    }

    after();
  }
}

new A().foo();
🙁 Actual behavior

Running the output throws super.a is not a function

🙂 Expected behavior

The output code should log "super.a"

Additional information about the issue

No response

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.