This commit is contained in:
Бондарев Иван 2020-05-25 21:47:44 +02:00
parent d8e21e7b4a
commit 8c198adedc
2 changed files with 13 additions and 2 deletions

View file

@ -3483,8 +3483,9 @@ namespace PascalABCCompiler.NETGenerator
PushIntConst(il, i - 2 - rank); PushIntConst(il, i - 2 - rank);
ILGenerator ilb = this.il; ILGenerator ilb = this.il;
if (ti != null && ti.tp.IsValueType && !TypeFactory.IsStandType(ti.tp) && !ti.tp.IsEnum) if (ti != null && ti.tp.IsValueType && !TypeFactory.IsStandType(ti.tp) && (helper.IsConstructedGenericType(ti.tp) || ti.tp.IsGenericType || !ti.tp.IsEnum))
il.Emit(OpCodes.Ldelema, ti.tp); if (!(ti.tp is EnumBuilder))
il.Emit(OpCodes.Ldelema, ti.tp);
this.il = il; this.il = il;
exprs[i].visit(this); exprs[i].visit(this);

10
TestSuite/enum5.pas Normal file
View file

@ -0,0 +1,10 @@
uses System;
type
Enum = (A, B);
begin
var arr := new ValueTuple<Enum, Enum>[](new ValueTuple<Enum, Enum>(A,B));
assert(arr[0].Item1 = A);
assert(arr[0].Item2 = B);
end.