Skip to content

Commit 36754a0

Browse files
authored
Fix encoding generic arrays (#219)
1 parent 9183e36 commit 36754a0

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

MetadataProcessor.Shared/Tables/nanoSignaturesTable.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -437,18 +437,8 @@ public void WriteDataType(
437437
{
438438
ArrayType array = (ArrayType)typeDefinition;
439439

440-
if (array.ElementType.IsGenericParameter)
441-
{
442-
// ECMA 335 VI.B.4.3 Metadata
443-
writer.WriteByte((byte)NanoCLRDataType.DATATYPE_VAR);
444-
445-
// OK to use byte here as we won't support more than 0x7F generic parameters
446-
writer.WriteByte((byte)(array.ElementType as GenericParameter).Position);
447-
}
448-
else
449-
{
450-
WriteDataType(array.ElementType, writer, true, expandEnumType, isTypeDefinition);
451-
}
440+
// Recursively encode the element type, which handles generic parameters correctly
441+
WriteDataType(array.ElementType, writer, true, expandEnumType, isTypeDefinition);
452442
}
453443

454444
return;

0 commit comments

Comments
 (0)