bug fix #1269
This commit is contained in:
parent
2fdc2f515a
commit
7d3d4908ab
|
|
@ -7889,7 +7889,8 @@ namespace PascalABCCompiler.NETGenerator
|
|||
private void AssignToStaticField(IExpressionNode to, IExpressionNode from)
|
||||
{
|
||||
IStaticCommonClassFieldReferenceNode value = (IStaticCommonClassFieldReferenceNode)to;
|
||||
FieldInfo fi = helper.GetField(value.static_field).fi;
|
||||
FldInfo fi_info = helper.GetField(value.static_field);
|
||||
FieldInfo fi = fi_info.fi;
|
||||
TypeInfo ti = helper.GetTypeReference(to.type);
|
||||
if (to.type.is_value_type)
|
||||
{
|
||||
|
|
@ -7920,7 +7921,7 @@ namespace PascalABCCompiler.NETGenerator
|
|||
if (ti != null)
|
||||
EmitBox(from, ti.tp);
|
||||
else
|
||||
EmitBox(from, fi.FieldType);
|
||||
EmitBox(from, fi_info.field_type);
|
||||
CheckArrayAssign(to, from, il);
|
||||
il.Emit(OpCodes.Stsfld, fi);
|
||||
}
|
||||
|
|
|
|||
19
TestSuite/lambdas_static_fields.pas
Normal file
19
TestSuite/lambdas_static_fields.pas
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
type
|
||||
t1<T>=class
|
||||
|
||||
static p0: Action<T>;
|
||||
|
||||
static procedure p1(p: Action<T>);
|
||||
begin
|
||||
t1&<T>.p0 := o1->p(o1);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
var i: integer;
|
||||
|
||||
begin
|
||||
t1&<integer>.p1(x->begin i := x; end);
|
||||
t1&<integer>.p0(1);
|
||||
assert(i = 1);
|
||||
end.
|
||||
Loading…
Reference in a new issue