[nem-en] How field initializers are parsed?

Andrey Khropov andrey.khropov at gmail.com
Fri Dec 15 22:42:37 CET 2006


Hello,

I've a question. How field initializers are dealt with in the compiler.
Because I have a problem. I see that some hidden methods are created in
TypeBuilder, e.g. :

for field declaration
-------------------------------------------
private  mutable  components : System.ComponentModel.IContainer = null;
-------------------------------------------

I get the method

-------------------------------------------------
Form1._N_field_initialiser__components() : void
-------------------------------------------------

The typed body of this method is just {()} and when I use
MethodBuilder.BodyTyped on it assertion fails because its Location's FileIndex
is 0.

So what's this strange method is about (doesn't FieldBuilder.const_value
contain enough information) ?

This question may be vs-integration specific because I encountered this during
parsing Project declarations.

-- 
AKhropov




More information about the devel-en mailing list