mirror of
https://github.com/swc-project/swc.git
synced 2024-12-18 19:21:33 +03:00
43 lines
551 B
TypeScript
43 lines
551 B
TypeScript
type BrandedNum = number & { __numberBrand: any };
|
|
var x : BrandedNum;
|
|
|
|
// operator >
|
|
x > 0;
|
|
x > <number>0;
|
|
x > <BrandedNum>0;
|
|
|
|
// operator <
|
|
x < 0;
|
|
x < <number>0;
|
|
x < <BrandedNum>0;
|
|
|
|
// operator >=
|
|
x >= 0;
|
|
x >= <number>0;
|
|
x >= <BrandedNum>0;
|
|
|
|
// operator <=
|
|
x <= 0;
|
|
x <= <number>0;
|
|
x <= <BrandedNum>0;
|
|
|
|
// operator ==
|
|
x == 0;
|
|
x == <number>0;
|
|
x == <BrandedNum>0;
|
|
|
|
// operator !=
|
|
x != 0;
|
|
x != <number>0;
|
|
x != <BrandedNum>0;
|
|
|
|
// operator ===
|
|
x === 0;
|
|
x === <number>0;
|
|
x === <BrandedNum>0;
|
|
|
|
// operator !==
|
|
x !== 0;
|
|
x !== <number>0;
|
|
x !== <BrandedNum>0;
|