microsoft / microsoft/TypeScript

Wrong `super` in class element decorator

オープン
#57,461 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

@rbuckton がすでに取り組んでいます。

2024年2月21日 から。

Needs Investigation
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

🔎 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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。