microsoft / microsoft/TypeScript
'bigint' is not comparable to 'number' with loose equality
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
TypeScript Version: 3.3.3
Search Terms: bigin == number not comparable loose equality
Code
1n == 1
error:
This condition will always return 'false' since the types 'bigint' and 'number' have no overlap.
but in chrome 72.0.3626.121
> 1n == 1
< true
and in MDN https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt

And similar issues
let x = [1, 2, 3]
x[1n]
error:
Type '1n' cannot be used as an index type.
in Chrome
> let x = [1, 2, 3]
x[1n]
< 2
Playground Link:
http://www.typescriptlang.org/play/index.html#src=1n%20%3D%3D%201
http://www.typescriptlang.org/play/index.html#src=let%20x%20%3D%20%5B1%2C%202%2C%203%5D%0D%0Ax%5B1n%5D
Related Issues:
https://github.com/Microsoft/TypeScript/issues/30655
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Issue にある TypeScript 3.3.3 の 2 つの再現例から始めます。1n と 1 の緩い等価性、および 1n による配列のインデックス指定です。報告された TypeScript のエラーを Chrome と MDN の動作と比較し、その後、関連する issue #30655 を確認します。両方の例で意図された BigInt の動作が一貫して解決され、回帰テストで検証されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100