TS7: `@extends` is ignored when the heritage is a call expression (Base.extend())
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript, typescript
- 领域
- compilers
调研方向
先从链接的复现用例及其 repro.js 示例开始,然后使用所引用的 TypeScript 7.1.0-dev 构建运行它,以确认 ViaCall 上的 TS8026 诊断。将 Base.extend() 继承情况与正常工作的 Base 标识符情况进行比较,并定位涉及的 JSDoc @extends 处理逻辑。当调用表达式情况不产生错误,同时现有行为保持不变时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
🔎 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
// @ts-check
/**
* @template T
*/
class Base {
/** @returns {T} */
get value() {
throw new Error();
}
/** @returns {typeof Base} */
static extend() {
return this;
}
}
/** @extends {Base<string>} */
class ViaCall extends Base.extend() {}
/** @extends {Base<string>} */
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<T> 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
- 主要语言
- Go
- 星标
- 111k
- 派生
- 14.4k
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 117
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/TypeScript 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
microsoft/TypeScript#64322 · 2 条评论 · 1 个 reaction · 已指派 2 人 ·
-
Possible Improvement
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/TypeScript#64278 · 1 条评论 · 1 个 reaction ·
-
Docs
难度 2/5 1-3 小时 新手友好度 70/100
microsoft/TypeScript#64118 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
microsoft/TypeScript#64094 ·
-
Docs
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/TypeScript#63959 · 5 条评论 ·
查看 microsoft/TypeScript 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 92/100
milvus-io/birdwatcher#545 ·
-
kind/bug
难度 2/5 1-3 小时 新手友好度 88/100
kubernetes-sigs/prow#953 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 88/100
caddyserver/caddy#8046 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
jaegertracing/jaeger#9588 ·