Ejemplo n.º 1
0
        private BoundExpression BindUnaryExpression(UnaryExpressionSyntax expressionSyntax)
        {
            var boundOperand  = BindExpression(expressionSyntax.Operand);
            var boundOperator = BoundUnaryOperator.Bind(expressionSyntax.OperatorToken.Kind, boundOperand.Type);

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

            return(new BoundUnaryExpression(boundOperator, boundOperand));
        }
Ejemplo n.º 2
0
 public BoundUnaryExpression(BoundUnaryOperator operatorUnit, BoundExpression operand)
 {
     OperatorUnit = operatorUnit;
     Operand      = operand;
 }