integer *= float not supported
Closed this issue · 1 comments
As wicked as it may sound, LSL supports IntegerLvalue *= FloatExpression
.
The semantics are the same as in this:
IntegerLvalue = (integer)((float)IntegerLvalue * (FloatExpression));
The *=
operator is thus the only exception to the rule that a float is never implicitly cast to integer. However, lslint errors out:
ERROR:: ( 7, 1): Invalid operator: integer = float.
This is going to be though to fix: lslint converts any var op= expression
assignments to the internal representation var = var op (expression)
as it parses, and it has no type information at that time. This case will need special treatment. It's probably more trouble than it's worth, though - if you're doing it knowing what you do, you probably can just ignore the error and move on; and if you're doing it by mistake, the error is explicit enough.
So, it's actually a nitpick that the error should be a warning. But I'm throwing it in for consideration.