bug fix #910
This commit is contained in:
parent
27e7e66c49
commit
f531c96760
|
|
@ -6919,7 +6919,7 @@ namespace PascalABCCompiler.NETGenerator
|
||||||
{
|
{
|
||||||
il.Emit(OpCodes.Box, helper.GetTypeReference(value.obj.conversion_type).tp);
|
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);
|
LocalBuilder lb = il.DeclareLocal(helper.GetTypeReference(value.obj.type).tp);
|
||||||
il.Emit(OpCodes.Stloc, lb);
|
il.Emit(OpCodes.Stloc, lb);
|
||||||
|
|
|
||||||
11
TestSuite/records9.pas
Normal file
11
TestSuite/records9.pas
Normal 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.
|
||||||
Loading…
Reference in a new issue