This commit is contained in:
Бондарев Иван 2018-06-12 22:02:20 +02:00
parent 27e7e66c49
commit f531c96760
2 changed files with 12 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) && !(value.obj is ICommonMethodCallNode))
else if (value.obj.type.is_value_type && !(value.obj is IAddressedExpressionNode) && !(value.obj is IThisNode) && !(value.obj is ICommonMethodCallNode) && !(value.obj is ICommonConstructorCall))
{
LocalBuilder lb = il.DeclareLocal(helper.GetTypeReference(value.obj.type).tp);
il.Emit(OpCodes.Stloc, lb);

11
TestSuite/records9.pas Normal file
View file

@ -0,0 +1,11 @@
type
t1=record
b:byte := 5;
function f1 := b;
constructor(b:byte) := self.b := b;
end;
begin
var b := (new t1(5)).f1;
assert(b = 5)//должно выводить 5, но выводит мусор, там такое же преобразование как в #901
end.