1

Closed

Read PEFile with Exception when generic param constraint is a generic parameter

description

Write a simple class as following:
public class ClassA<T1, T2>
{
  private class ClassB<T3> where T3 : T2
  {
  }
}
Compile it with in a dll, and Read the dll by using PEFile.ReadPEFile, an exception will happened.
 Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'QUT.PERWAPI.GenericParam' to type 'QUT.PERWAPI.Class'.
Exception happend in MDElements.cs, see attached screenshot.

file attachments

Closed Aug 5, 2010 at 1:56 AM by k_john_gough
Release 1.1.4.53604 resolves this issue.

comments

k_john_gough wrote Aug 3, 2010 at 2:57 AM

Hi All.
xie is right, the current version does not implement constraints correctly in this case.

I am doing a rewrite of that part of the code. It will go up later this week, after some more testing.
John

k_john_gough wrote Aug 4, 2010 at 11:25 AM

Hi All.
I have checked in the fixed sources in the source repository. I will upload the new distribution in the next few days. Otherwise you may build the DLL yourself from the source.
John

wrote Aug 5, 2010 at 1:56 AM

wrote Feb 13, 2013 at 1:06 AM

wrote May 15, 2013 at 2:59 AM