Binary operator checking #92
Labels
blocking
These issues are blocking the checker being used in projects
checking
Issues around checking
enhancement
New feature or request
good-second-issue
Moderately difficult issue
Milestone
Current the functions to doing binary operations don't check the types of either side. First a bit of background:
There are two functions for binary operators, they are split between
in
andinstanceof
operators are handled specially onEnvironment
There is a also a current option
strict_casts
(it should probably be renamed tono_implicit_casts
) inTypeCheckOptions
. When this istrue
should not allow operations like"hi" + 2
.These two functions are currently set up to return a
Result
. However both the logic for checking the sides and the diagnostic has not been implemented. For exampleezno/checker/src/behavior/operations.rs
Lines 76 to 84 in 5021262
There are several things to carefully consider here
Symbol.toPrimative
behaviour with hints and such (that will require these functions to have all the context to be able to do acall_type
Object.toPrimative
fall through as this result are not usefulThe text was updated successfully, but these errors were encountered: