microsoft / microsoft/TypeScript
Bug: Chained this-intersecting methods don't work from within class
オープン
@weswigham がすでに取り組んでいます。
2018年12月8日 から。
Bug
Domain: This-Typing
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
TypeScript Version: 3.1.1-insiders.20180926
Search Terms: this chain
Code
class Builder {
private _class: undefined;
withFoo<T>() {
return this as this & { foo: T }
}
withBar<T>() {
return this as this & { bar: T }
}
withFooBar<T>() {
return this.withFoo<T>().withBar<T>();
}
}
let good = new Builder().withFoo<number>().withBar<number>();
let bad = new Builder().withFooBar<number>();
good = bad;
Expected behavior:
good & bad should be identical
Actual behavior:
bad is missing foo
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。