Closed mrvoorhe closed 2 years ago
This was found as part of https://github.com/dotnet/linker/issues/2332
Thanks for filing this with a repro, I'll have a look.
I tinkered a bit with trying to fix it but no luck yet. I added case ElementType.GenericInst:
here https://github.com/jbevain/cecil/blob/master/Mono.Cecil/AssemblyReader.cs#L3605. That seemed to get further. Then the test would crash in ReadCustomAttributeFieldOrPropType
.
I have another test with arrays I will commit. I'm sure you can fix this faster than I can, I'll let you take it from here.
Here is an additional test with an array https://github.com/Unity-Technologies/cecil/commit/35c63a43991956d68bac77f550540ae07a80e48e
Here is a branch with a unit test to reproduce https://github.com/Unity-Technologies/cecil/commits/master-cannot-read-enum-declared-in-generic-type
And the commit itself with the unit test https://github.com/Unity-Technologies/cecil/commit/53d375c553e77218601ab6c206472dc800fa8636
The asserts after the exception may not be exactly correctly