Boo.Lang.Compiler.Steps.ProcessMethodBodies.LeaveAddressOf C# (CSharp) Method

LeaveAddressOf() private method

private LeaveAddressOf ( UnaryExpression node ) : void
node Boo.Lang.Compiler.Ast.UnaryExpression
return void
        private void LeaveAddressOf(UnaryExpression node)
        {
            IType dataType = GetExpressionType(node.Operand);
            if (dataType.IsArray) //if array reference take address of first element
            {
                dataType = dataType.ElementType;
                node.Replace(node.Operand, new SlicingExpression(node.Operand, new IntegerLiteralExpression(0)));
                BindExpressionType(node.Operand, dataType);
            }
            if (TypeSystemServices.IsPointerCompatible(dataType))
            {
                node.Entity = dataType.MakePointerType();
                BindExpressionType(node, dataType.MakePointerType());
                return;
            }

            BindExpressionType(node, TypeSystemServices.ErrorEntity);
            Error(CompilerErrorFactory.PointerIncompatibleType(node.Operand, dataType));
        }
ProcessMethodBodies