Boo.Lang.Compiler.Steps.ProcessMethodBodies.OnField C# (CSharp) Метод

OnField() публичный Метод

public OnField ( Boo.Lang.Compiler.Ast.Field node ) : void
node Boo.Lang.Compiler.Ast.Field
Результат void
        public override void OnField(Field node)
        {
            if (WasVisited(node))
                return;
            MarkVisited(node);

            var entity = (InternalField)GetEntity(node);

            Visit(node.Attributes);
            Visit(node.Type);

            if (node.Initializer != null)
            {
                var type = (null != node.Type) ? GetType(node.Type) : null;
                if (null != type && TypeSystemServices.IsNullable(type))
                    BindNullableInitializer(node, node.Initializer, type);

                if (entity.DeclaringType.IsValueType && !node.IsStatic)
                    Error(CompilerErrorFactory.ValueTypeFieldsCannotHaveInitializers(node.Initializer));

                try
                {
                    PushMember(node);
                    PreProcessFieldInitializer(node);
                }
                finally
                {
                    PopMember();
                }
            }
            else
            {
                if (null == node.Type)
                {
                    node.Type = CreateTypeReference(node.LexicalInfo, TypeSystemServices.ObjectType);
                }
            }
            CheckFieldType(node.Type);
        }
ProcessMethodBodies