-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic operator checking #186
Conversation
- Also constant less than, greater than checks
- cargo fmt - fix clippy lints - remove disjoint operator checking (will add back in #186)
- Internal .d.ts fix - Infer in template literal fix - refactor of type helpers
- Type parameter extends checking on arguments - Add more interal types for numbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty much done what I want for the initial functionality. Some things I might continue to add
- More checking for numbers
- Operations on number intrinsics (might need to add result type for
Constructor::BinaryOperator
)- Has some problems caused by floats
- Operations with zero, one, infinity, negative infinity
- Operations on number intrinsics (might need to add result type for
- More disjoint
- Not intrinsic needs subtyping loop
- Number intrinsics (also more in subtyping)
Math.sin
,Math.random
types- These are inclusive inequalities though, not sure about
0 | 1 | (GreaterThan<0> & LessThan<1>)
:/. Maybe a new intrinsic for a inclusive range? Both seem bloat
- These are inclusive inequalities though, not sure about
- Fixes and more
Number.isNaN
narrowing casesArray.isArray
doesn't work because of Array as free variable (used before class declared) (maybe do before hand)
This comment was marked as resolved.
This comment was marked as resolved.
- Swap over LessThan and GreaterThan to use this mechanism - Fix for asserts annotation - Add disjoint not using subtyping (currently broken for `if_and_else_across_function`) - Currently broken in the range below case :( - Array.isArray - Number.isNaN but not working - 330 passing
- More Range things (i can't do math on Friday evening) - Move `undefined` back to `Type::Constant` - Change disjoint order for fix - Printing override for LT & GT
Will have a think about later if there is still stuff I want to add/change before merging tomorrow. But pretty happy with it for now. |
- Move FloatRange - Fixes to disjoint ranges - Add imul - Add number of type arguments to type annotation error - Change unary operators to use existing constructs - Add examples.yml
- Added tests for FloatRange
Merging before I get carried away with range division etc. Checking tests now up to 344 🎉 |
NaN
Not
works (using subtyping)infer T
in type annotation slice gets treated asinfer T extends string
(and also for generic arguments)Number.isNaN
checksGreaterThan
andLessThan
toInclusiveRange
andExclusiveRange
FloatRange
type~
,!
and-
prefix operators to be in terms ofx ^ 0xFFFF_FFFF
,x ? false : true
and0 - x
. RemovesConstructor::UnaryOperation
if (a)
where a isstring | falsy etc
and also to optional chaininga + b
is string or number toresult
field onConstructor::BinaryOperator { result }