microsoft / microsoft/TypeScript
Negated types
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
Sometimes it is desired to forbid certain types from being considered.
Example: `JSON.stringify(function() {});` doesn't make sense and the chance is high it's written like this by mistake. With negated types we could eliminate a chance of it.
``` typescript
type Serializable = any ~ Function; // or simply ~ Function
declare interface JSON {
stringify(value: Serializable): string;
}
```
Another example
``` typescript
export NonIdentifierExpression = ts.Expression ~ ts.Identifier
```
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ファイル、テスト、エントリポイントは指定されていません。まず、提案されている Serializable と NonIdentifierExpression の例を確認し、次に必要な型システムの動作と代入可能性への影響を判断します。否定型が一貫してサポートされ、適切なテストでカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 30/100