mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 06:05:02 +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;
|