Page MenuHomeFeedback Tracker

Or '|' on Bool works for two Booleans, but not three
Assigned, NormalPublic

Description

"bool | bool" may be used to add two bools; however, "bool | bool | bool" or "(bool | bool) | bool" is forbidden.

Details

Severity
Trivial
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
General
Steps To Reproduce
bool a = true;
bool b = true;
bool c = false;
int count = (int)a + (int)b + (int)c;
Print(count);
int test = a|b;
Print(test);
/* The following lines will result in errors, but the above will not. lol
SCRIPT    (E): execCode(8): error: '|' not supported on 'bool'
SCRIPT    (E): execCode(10): error: '|' not supported on 'bool'
*/
int failed_test = a|b|c;
Print(failed_test);
int failed_test_2 = (a|b)|c;
Print(failed_test_2);

Event Timeline

Geez changed the task status from New to Assigned.Aug 5 2024, 3:09 PM