void BindBitwiseOperator(BinaryExpression node)
{
IType lhs = GetExpressionType(node.Left);
IType rhs = GetExpressionType(node.Right);
if (TypeSystemServices.IsIntegerOrBool(lhs) &&
TypeSystemServices.IsIntegerOrBool(rhs))
{
IType type;
switch (node.Operator)
{
case BinaryOperatorType.ShiftLeft:
case BinaryOperatorType.ShiftRight:
type = lhs;
break;
default:
type = TypeSystemServices.GetPromotedNumberType(lhs, rhs);
break;
}
BindExpressionType(node, type);
}
else
{
// if (lhs.IsEnum && rhs == lhs)
// {
// BindExpressionType(node, lhs);
// }
// else
// {
if (!ResolveOperator(node))
{
InvalidOperatorForTypes(node);
}
// }
}
}