Discussion:
Question about MType
Sergei Tulentsev
2007-08-24 12:47:48 UTC
Permalink
I discovered a bug in WinForms designer and I would like to fix it, but
first I need some help :-)

I see there this code
protected virtual CreateField(field: FieldBuilder) : CodeMemberField
{
// GetFieldInfo() doesn't work
//def fieldDecl = CodeMemberField(field.GetFieldInfo().FieldType,
field.Name);

Debug.Print($"CreateField: from field $field");

//def fieldDecl = CodeMemberField(field.Ast.ty.ToString(), field.Name
);
def fieldDecl = CodeMemberField(field.GetMemType().SystemType,
field.Name); // NRE here

The problem is highlighted. What is this field for and under what
circumstances can it be null?
--
Best wishes,
Sergei Tulentsev
Senior software engineer.

SITRONICS Telecom Solutions, Moscow
http://www.sitels.ru
mob: + 7 916 507 7112
Kamil Skalski
2007-08-24 13:24:29 UTC
Permalink
Post by Sergei Tulentsev
field.Name);
def fieldDecl = CodeMemberField(field.GetMemType().SystemType,
field.Name); // NRE here
MemberBuilder.SystemType field contains the
System.Reflection.Emit.XXXBuilder object created during emission of
assembly to disk.
Post by Sergei Tulentsev
The problem is highlighted. What is this field for and under what
circumstances can it be null?
It will be null until the actual code generation begins. I guess this
stage does not happen in Integration or your problem occurs before it
is started (for whole project or maybe for this particular field).

The best thing to do would be not to use SystemType at all in
Integration, since it is related to code generation, which shouldn't
be performed inside Integration.
Post by Sergei Tulentsev
--
Best wishes,
Sergei Tulentsev
Senior software engineer.
SITRONICS Telecom Solutions, Moscow
http://www.sitels.ru
mob: + 7 916 507 7112
--
Best wishes,
Sergei Tulentsev
Senior software engineer.
SITRONICS Telecom Solutions, Moscow
http://www.sitels.ru
mob: + 7 916 507 7112
--
Kamil Skalski
http://nazgul.omega.pl
Loading...