This commit is contained in:
Бондарев Иван 2018-06-10 19:04:11 +02:00
parent 154ecc1533
commit 752d17c296
2 changed files with 26 additions and 1 deletions

View file

@ -6919,7 +6919,7 @@ namespace PascalABCCompiler.NETGenerator
{
il.Emit(OpCodes.Box, helper.GetTypeReference(value.obj.conversion_type).tp);
}
else if (value.obj.type.is_value_type && !(value.obj is IAddressedExpressionNode) && !(value.obj is IThisNode))
else if (value.obj.type.is_value_type && !(value.obj is IAddressedExpressionNode) && !(value.obj is IThisNode) && !(value.obj is ICommonMethodCallNode))
{
LocalBuilder lb = il.DeclareLocal(helper.GetTypeReference(value.obj.type).tp);
il.Emit(OpCodes.Stloc, lb);

25
TestSuite/records8.pas Normal file
View file

@ -0,0 +1,25 @@
type
t1=record
public x,y:integer;
function p1 := (x, y);
end;
t2=class
_p1:t1;
property p1:t1 read _p1;
function GetP1 := _p1;//не обязательно короткая функция
end;
begin
var a:=new t2;
a._p1 := new t1;
a._p1.x := 3;
a._p1.y := 5;
var t := a.p1.p1;
assert(t.Item1 = 3);
assert(t.Item2 = 5);
end.