Exemplo n.º 1
0
        private BoundExpression BindUnaryExpression(UnaryOperationExpressionSyntax expression)
        {
            var boundOperand  = Bind(expression.Operand);
            var boundOperator = BoundUnaryOperator.Bind(expression.OperatorToken.Kind, boundOperand.Type);

            if (boundOperator == null)
            {
                diagnostics.ReportUndefinedUnaryOperator(expression.OperatorToken.Span, expression.OperatorToken.Text, boundOperand.Type);
                return(boundOperand);
            }

            return(new BoundUnaryExpression(boundOperator, boundOperand));
        }
Exemplo n.º 2
0
 public BoundUnaryExpression(BoundUnaryOperator op, BoundExpression operand)
 {
     Operator = op;
     Operand  = operand;
 }