This commit is contained in:
Ivan Bondarev 2022-12-25 11:38:45 +01:00
parent c1c4e4499a
commit 15cd6f0bd0
2 changed files with 15 additions and 1 deletions

View file

@ -8170,7 +8170,7 @@ namespace PascalABCCompiler.NETGenerator
//Массив присваиваем массиву=>надо вызвать копирование //Массив присваиваем массиву=>надо вызвать копирование
TypeInfo ti_l = helper.GetTypeReference(to.type); TypeInfo ti_l = helper.GetTypeReference(to.type);
TypeInfo ti_r = helper.GetTypeReference(from.type); TypeInfo ti_r = helper.GetTypeReference(from.type);
if (ti_l.is_arr && ti_r.is_arr) if (ti_l.is_arr && ti_r.is_arr && !(to is ILocalBlockVariableReferenceNode && (to as ILocalBlockVariableReferenceNode).Variable.name.StartsWith("$TV")))
{ {
il.Emit(OpCodes.Call, ti_r.clone_meth); il.Emit(OpCodes.Call, ti_r.clone_meth);
} }

14
TestSuite/with4.pas Normal file
View file

@ -0,0 +1,14 @@
 type
TRec = record
b: integer;
end;
begin
var a: array [0..1,0..1] of TRec;
with a[0,0] do
begin
b := 2;
end;
assert(a[0,0].b = 2);
end.