Sre cleanup9 (#3661)
[mono.git] / mcs / class / corlib / System.Reflection.Emit / ConstructorOnTypeBuilderInst.cs
index 149e5dbd6633d1a5d6940d761cfcc18be4a8e37f..b79094639717ed6d4d633488134fede0e372ce76 100644 (file)
@@ -42,8 +42,8 @@ namespace System.Reflection.Emit
        internal class ConstructorOnTypeBuilderInst : ConstructorInfo
        {
                #region Keep in sync with object-internals.h
-               MonoGenericClass instantiation;
-               ConstructorInfo cb;
+               internal MonoGenericClass instantiation;
+               internal ConstructorInfo cb;
                #endregion
 
                public ConstructorOnTypeBuilderInst (MonoGenericClass instantiation, ConstructorInfo cb)
@@ -134,6 +134,25 @@ namespace System.Reflection.Emit
                        return res;
                }
 
+               internal override Type[] GetParameterTypes () {
+                       if (cb is ConstructorBuilder) {
+                               return (cb as ConstructorBuilder).parameters;
+                       } else {
+                               ParameterInfo[] parms = cb.GetParameters ();
+                               var res = new Type [parms.Length];
+                               for (int i = 0; i < parms.Length; i++) {
+                                       res [i] = parms [i].ParameterType;
+                               }
+                               return res;
+                       }
+               }
+
+               // Called from the runtime to return the corresponding finished ConstructorInfo object
+               internal ConstructorInfo RuntimeResolve () {
+                       var type = instantiation.InternalResolve ();
+                       return type.GetConstructor (cb);
+               }
+
                public override int MetadataToken {
                        get {
                                return base.MetadataToken;