-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Open
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureHas ReproThis issue has compiler-backed repros: https://aka.ms/ts-reprosThis issue has compiler-backed repros: https://aka.ms/ts-reprosSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Bug Report
π Search Terms
- bigint
- bitwise
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about bigint.
β― Playground Link
π» Code
//@target: ES2020
const v1 = 1n as any;
const v2 = 2n as never;
const v3 = v1 | v2; // v3 should be typed (number | bigint), but is number
π Actual behavior
The result of the bitwise operations &
, |
, ^
and ~
is assumed to be a number
when all the operands have unspecified type, like any
or never
.
π Expected behavior
The result of bitwise operations with unspecified type operands should be number | bigint
.
Metadata
Metadata
Assignees
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureHas ReproThis issue has compiler-backed repros: https://aka.ms/ts-reprosThis issue has compiler-backed repros: https://aka.ms/ts-reprosSuggestionAn idea for TypeScriptAn idea for TypeScript