ID:2135540
 
BYOND Version:510.1346
Operating System:Linux
Web Browser:Chrome 52.0.2743.85
Applies to:Dream Daemon
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
The bitshift operators (<< and >>) seem to accept any operands they are given; if the left value is not a number, the result is zero; if the right value is not a number, the result is the left value.

Numbered Steps to Reproduce Problem:
see code below

Code Snippet (if applicable) to Reproduce Problem:
/world/New()
world.log << (3 << 3) // 24
world.log << ("foo" << 3) // 0
world.log << (3 << new /datum) // 3
world.log << (/obj << /mob) // 0

world.log << (32 >> 3) // 4
world.log << ("foo" >> 3) // 0
world.log << (3 >> new /datum) // 3
world.log << (/obj >> /mob) // 0


Expected Results: Runtime if a non-numeric value is used as an operand to a bitshift operator.

Actual Results: If the left operand is not a number, zero; if the right operand is not a number, the left operand.

Does the problem occur:
Every time? Or how often? Every time
In other games? Yes
In other user accounts? Yes
On other computers? Yes

When does the problem NOT occur? Unknown

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Unknown

Workarounds: Check the operands are numbers first?