Open
Description
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:
#30655