sirisian / ecmascript-types

ECMAScript Optional Static Typing Proposal http://sirisian.github.io/ecmascript-types/
453 stars 4 forks source link

Compatibility with typeof of ecmascript #60

Open cesarchefinho opened 3 years ago

cesarchefinho commented 3 years ago

Make typeof returns number, object, string and etc

Typeof uint32 will return number

And make a new word to check types

Like

statictypeof uint32 will return uint32

sirisian commented 3 years ago

I updated the README, but at the same time I wonder if this is ideal. Consider how BigInt works. It returns "bigint" and not "object". I think I'd need to speak to one of the tc39 editors to understand their direction.

cesarchefinho commented 3 years ago

The problem is that uint32 999 is a number for current ecmascript and previous code that expect number will be broken.

sirisian commented 3 years ago

ah, yeah that makes sense. Sounds good then.