I would like to request an engine property that would disable bitwise operations on non-integer types, producing a compile error.
I have many users whose only coding experience is in Excel, either through Excel formulas or VBA. Both of those languages use the ^ operator as a "pow" operator, so these users will often make the mistake of using the ^ operator in AngelScript. In almost every case, these users are using the ^ operator by mistake with at least one floating-point type or a class that can convert to a floating-point type. A compile error that catches "(double) ^ (int)" would help these users learn that ^ is an XOR operator.
Since the engine doesn't actually support bitwise, floating-point operations (instead, implicitly converting floating-point types to integer types before the operation), it doesn't seem like an option to produce a compile error would cause much trouble.
Let me know what you think. Thanks.
↧