microsoft / microsoft/TypeScript
Unexpected TS4094 with the build parameter `declaration: true`
未关闭
还没有人认领这个 Issue。
Bug
Domain: Declaration Emit
Needs Human Review
- 主要语言
- Go
- 星标
- 111k
- 派生
- 14.3k
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 132
描述
TypeScript Version: 2.4.1
Code
var Foo = class Foo {
private _message = "Hi";
hi() { return this._message; }
}
tsc test.ts -t es2017 -d
Expected behavior: -d should not cause this message: test.ts(1,5): error TS4094: Property '_message' of exported class expression may not be private or protected.
Actual behavior: It does.
There should at least be a suppression parameter to ignore this error.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,使用 TypeScript 2.4.1 命令 tsc test.ts -t es2017 -d 以及 test.ts 中所示的类表达式重现该报告。跟踪导声明生成过程以及针对导出类表达式的 TS4094 诊断,然后确定相关的编译器测试入口点。当所报告的声明构建不再输出意外错误,或请求的抑制行为已由回归测试覆盖时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- compilers
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100