bug fix #2238
This commit is contained in:
parent
d8e21e7b4a
commit
8c198adedc
|
|
@ -3483,8 +3483,9 @@ namespace PascalABCCompiler.NETGenerator
|
|||
PushIntConst(il, i - 2 - rank);
|
||||
ILGenerator ilb = this.il;
|
||||
|
||||
if (ti != null && ti.tp.IsValueType && !TypeFactory.IsStandType(ti.tp) && !ti.tp.IsEnum)
|
||||
il.Emit(OpCodes.Ldelema, ti.tp);
|
||||
if (ti != null && ti.tp.IsValueType && !TypeFactory.IsStandType(ti.tp) && (helper.IsConstructedGenericType(ti.tp) || ti.tp.IsGenericType || !ti.tp.IsEnum))
|
||||
if (!(ti.tp is EnumBuilder))
|
||||
il.Emit(OpCodes.Ldelema, ti.tp);
|
||||
|
||||
this.il = il;
|
||||
exprs[i].visit(this);
|
||||
|
|
|
|||
10
TestSuite/enum5.pas
Normal file
10
TestSuite/enum5.pas
Normal 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.
|
||||
Loading…
Reference in a new issue