microsoft / microsoft/TypeScript
TS7: `@extends` is ignored when the heritage is a call expression (Base.extend())
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- PR merge metrics
- PR metrics pending
Description
### 🔎 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_
Contributor guide
Research direction
Start with the linked reproduction and its repro.js example, then run it against the cited TypeScript 7.1.0-dev build to confirm the TS8026 diagnostic on ViaCall. Compare the Base.extend() heritage case with the working Base identifier case and locate the JSDoc @extends handling involved. Done means the call-expression case produces no error while the existing behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100