Author: jbevain
Date: 2007-07-22 07:18:24 -0400 (Sun, 22 Jul 2007)
New Revision: 82435

Modified:
   trunk/mcs/class/Mono.Cecil/Mono.Cecil/DefaultImporter.cs
   trunk/mcs/class/Mono.Cecil/Mono.Cecil/ReflectionReader.cs
Log:
use new GetOriginalType method

Modified: trunk/mcs/class/Mono.Cecil/Mono.Cecil/DefaultImporter.cs
===================================================================
--- trunk/mcs/class/Mono.Cecil/Mono.Cecil/DefaultImporter.cs    2007-07-22 
10:55:00 UTC (rev 82434)
+++ trunk/mcs/class/Mono.Cecil/Mono.Cecil/DefaultImporter.cs    2007-07-22 
11:18:24 UTC (rev 82435)
@@ -197,9 +197,7 @@
                                mr.CallingConvention);
                        meth.DeclaringType = ImportTypeReference 
(mr.DeclaringType, context);
 
-                       TypeReference contextType = meth.DeclaringType;
-                       while (contextType is TypeSpecification)
-                               contextType = (contextType as 
TypeSpecification).ElementType;
+                       TypeReference contextType = 
meth.DeclaringType.GetOriginalType ();
 
                        context.GenericContext.Method = meth;
                        context.GenericContext.Type = contextType;

Modified: trunk/mcs/class/Mono.Cecil/Mono.Cecil/ReflectionReader.cs
===================================================================
--- trunk/mcs/class/Mono.Cecil/Mono.Cecil/ReflectionReader.cs   2007-07-22 
10:55:00 UTC (rev 82434)
+++ trunk/mcs/class/Mono.Cecil/Mono.Cecil/ReflectionReader.cs   2007-07-22 
11:18:24 UTC (rev 82435)
@@ -1154,8 +1154,7 @@
                                size = 8;
                                break;
                        default:
-                               while (fieldType is TypeSpecification)
-                                       fieldType = ((TypeSpecification) 
fieldType).ElementType;
+                               fieldType = fieldType.GetOriginalType ();
 
                                TypeDefinition fieldTypeDef = fieldType as 
TypeDefinition;
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to