diff --git a/NETGenerator/NETGenerator.cs b/NETGenerator/NETGenerator.cs index 69f7287f8..8f2e605ed 100644 --- a/NETGenerator/NETGenerator.cs +++ b/NETGenerator/NETGenerator.cs @@ -8170,7 +8170,7 @@ namespace PascalABCCompiler.NETGenerator //Массив присваиваем массиву=>надо вызвать копирование TypeInfo ti_l = helper.GetTypeReference(to.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); } diff --git a/TestSuite/with4.pas b/TestSuite/with4.pas new file mode 100644 index 000000000..899aa5111 --- /dev/null +++ b/TestSuite/with4.pas @@ -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. \ No newline at end of file