microsoft / microsoft/TypeScript

TS7: `@extends` is ignored when the heritage is a call expression (Base.extend())

オープン
#64,058 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
Bug
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

### 🔎 Search Terms

`extends js TS7 jsdoc`

nothing seemed directly related

### 🕗 Version & Regression Information

```
"typescript-7": "npm:typescript@7.1.0-dev.20260826.1"
```

### ⏯ Playground Link

https://github.com/NullVoxPopuli-ai-agent/typescript-go-jsdoc-extends-call-heritage

### 💻 Code

https://github.com/NullVoxPopuli-ai-agent/typescript-go-jsdoc-extends-call-heritage

```js
// @ts-check

/**
* @template T
*/
class Base {
/** @returns {T} */
get value() {
throw new Error();
}
/** @returns {typeof Base} */
static extend() {
return this;
}
}

/** @extends {Base} */
class ViaCall extends Base.extend() {}

/** @extends {Base} */
class ViaIdentifier extends Base {}

/** @type {string} */
const a = new ViaIdentifier().value; // ok in both

/** @type {string} */
const b = new ViaCall().value; // error in TS 7 only
```

### 🙁 Actual behavior

```
Version 7.1.0-dev.20260826.1
repro.js:18:23 - error TS8026: Expected Base type arguments; provide these with an '@extends' tag.

18 class ViaCall extends Base.extend() {}
~~~~~~~~~~~~~

Found 1 error in repro.js:18
```

### 🙂 Expected behavior

no error in TS7

### Additional information about the issue

_No response_

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

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

調査の方向性

リンクされた再現ケースとその repro.js の例から始め、続いて引用されている TypeScript 7.1.0-dev ビルドに対して実行し、ViaCall での TS8026 診断を確認します。Base.extend() の継承ケースと、動作する Base 識別子のケースを比較し、関係する JSDoc @extends の処理箇所を特定します。呼び出し式のケースでエラーが発生せず、既存の動作が維持されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, typescript
領域
compilers
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
68/100

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

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