private BoundExpression Negate(BoundExpression condition) { if (condition is BoundLiteralExpression literal) { bool value = (bool)literal.Value; return(new BoundLiteralExpression(!value)); } var op = BoundUnaryOperator.Bind(SyntaxKind.BangToken, TypeSymbol.Bool); return(new BoundUnaryExpression(op, condition)); }
public BoundUnaryExpression(BoundUnaryOperator op, BoundExpression operand) { Op = op; Operand = operand; }