microsoft / microsoft/TypeScript
Computing constraint of conditional type by replacing contravariant infer variables with their constraints is unsound
オープン
@ahejlsberg がすでに取り組んでいます。
2018年9月7日 から。
Bug
Domain: Conditional Types
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
TypeScript Version: master (8f654f0)
Search Terms:
conditional type assignability assignable constraint contravariant infer variable parameter unsound
Code
type Foo<A> = [A] extends [[infer B]] ? (arg: B) => void : never;
function fortyTwo<A>(x: Foo<A>) { x(42); }
fortyTwo<[string]>((arg: string) => console.log(arg.slice()));
Expected behavior: Compile error on x(42).
Actual behavior: Successful compilation and runtime error.
Playground Link: link
Related Issues: #26933
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。