Feature - Implemented boolean or-assignment and and-assignment operators behave incorrectly

picklish

Member
Code:
[color=green]> ash boolean x = true; x = x | false

Returned: true[/color]

[color=red]> ash boolean x = true; x |= false

Returned: false[/color]

[color=green]> ash boolean x = false; x = x & true

Returned: false[/color]

[color=red]> ash boolean x = false; x &= true

Returned: true[/color]
 

Veracity

Developer
Staff member
| and & are arithmetic operators, not boolean operators.

> ash int x = 1; x |= 2

Returned: 3

> ash int x = 7; x &= 5

Returned: 5
However, I will accept your FEATURE REQUEST to make them work for booleans, as well:

> ash boolean x = true; x |= false

Returned: true

> ash boolean x = false; x &= true

Returned: false
Revision 9299.
 
Top