void function() { bool a = (((int)true) | ((int)false)); // error int b = (int)true; int c = (int)false; bool d = b | c; // ok }
the code above generates a compile error with: "'|' not supported on 'bool'", the issue here is that the cast expression creates no effect, operands to the bitwise or are both (clearly) explicitly casted into an int type thus it should be valid. If the expression is split up, then it works fine (the last three lines).