fix getting MethodInfo

This commit is contained in:
samuraiGH 2024-06-29 15:49:13 +03:00
parent 5fa4d9fce7
commit 84b0dfe537

View file

@ -11610,12 +11610,7 @@ namespace PascalABCCompiler.NETGenerator
if (is_generic)
{
if (value.ElementType.node_kind == node_kind.compiled)
{
enumer_mi = TypeFactory.IEnumerableGenericType.MakeGenericType(elementType).GetMethod("GetEnumerator");
return_type = enumer_mi.ReturnType;
}
else
if (helper.IsConstructedGenericType(elementType))
{
enumer_mi = TypeBuilder.GetMethod(
TypeFactory.IEnumerableGenericType.MakeGenericType(elementType),
@ -11626,6 +11621,11 @@ namespace PascalABCCompiler.NETGenerator
.GetGenericTypeDefinition()
.MakeGenericType(elementType);
}
else
{
enumer_mi = TypeFactory.IEnumerableGenericType.MakeGenericType(elementType).GetMethod("GetEnumerator");
return_type = enumer_mi.ReturnType;
}
}
else
{