Re: [Mono-devel-list] [PATCH] TypeBuilder.GetMethod and other updates for .NET 2.0 beta2 API

2005-06-10 Thread Martin Baulig
On Thu, 2005-06-09 at 17:43 +0200, Kamil Skalski wrote:

 Sorry you had problems merging this patch. It was created against 45614.
 Seems like Zoltan was faster in adding some of the similar API:
 http://galactus.ximian.com/pipermail/mono-patches/2005-June/059635.html
 in 45626

Hello,

just committed the new version of the patch.

Sorry about yesterday's breakage, I was in a very bad mood and also
didn't have any time to test it before committing.

Martin


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] [PATCH] TypeBuilder.GetMethod and other updates for .NET 2.0 beta2 API

2005-06-09 Thread Kamil Skalski
Dnia roda, 8 czerwca 2005 22:40, Martin Baulig napisa:
 Hello,

 I'll commit it tomorrow morning.

 Don't worry, we're waiting with the release to get a few more of my
 fixes in, so this'll definitely go in :-)


Sorry you had problems merging this patch. It was created against 45614.
Seems like Zoltan was faster in adding some of the similar API:
http://galactus.ximian.com/pipermail/mono-patches/2005-June/059635.html
in 45626

I'm attaching the new patch, against 45700. Hope the will be no more problems 
(there are still some more 2.0 API additions there, so more conflicts are 
possible).

-- 
Kamil Skalski
http://nazgul.omega.pl
Index: class/corlib/System/Type.cs
===
--- class/corlib/System/Type.cs	(wersja 45700)
+++ class/corlib/System/Type.cs	(kopia robocza)
@@ -760,6 +760,22 @@
 			return GetMethodImpl (name, bindingAttr, binder, callConvention, types, modifiers);
 		}
 
+		internal virtual MethodInfo GetMethod (MethodInfo fromNoninstanciated)
+{
+			throw new System.InvalidOperationException (can only be called in generic type);
+}
+
+		internal virtual ConstructorInfo GetConstructor (ConstructorInfo fromNoninstanciated)
+{
+			throw new System.InvalidOperationException (can only be called in generic type);
+}
+
+		internal virtual FieldInfo GetField (FieldInfo fromNoninstanciated)
+{
+			throw new System.InvalidOperationException (can only be called in generic type);
+}
+
+		
 		public MethodInfo[] GetMethods ()
 		{
 			return GetMethods (DefaultBindingFlags);
@@ -1110,6 +1126,11 @@
 			return res;
 		}
 
+public Type MakeGenericType (Type[] types)
+{
+			return BindGenericParameters (types);
+}
+
 		public abstract bool IsGenericParameter {
 			get;
 		}
Index: class/corlib/System/ChangeLog
===
--- class/corlib/System/ChangeLog	(wersja 45700)
+++ class/corlib/System/ChangeLog	(kopia robocza)
@@ -1,3 +1,9 @@
+2005-06-09  Kamil Skalski [EMAIL PROTECTED]
+	* Type.cs: Add MakeGenericType method form .NET 2.0 beta 2 API
+
+	* Type.cs MonoType.cs: Add internal virtual Get{Method,Constructor,Field} 
+	for obtaining instanciated *Info objects from non-instanciated counterparts
+
 2005-06-09  Zoltan Varga  [EMAIL PROTECTED]
 
 	* ModuleHandle RuntimeMethodHandle.cs RuntimeTypeHandle.cs RuntimeFieldHandle.cs RuntimeArgumentHandle.cs: Add missing 2.0 attributes.
Index: class/corlib/System/MonoType.cs
===
--- class/corlib/System/MonoType.cs	(wersja 45700)
+++ class/corlib/System/MonoType.cs	(kopia robocza)
@@ -224,6 +224,31 @@
 		}
 
 		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		extern MethodInfo GetCorrespondingInflatedMethod (IntPtr generic);
+
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		extern ConstructorInfo GetCorrespondingInflatedConstructor (IntPtr generic);
+
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		extern FieldInfo GetCorrespondingInflatedField (IntPtr generic);
+
+
+		internal override MethodInfo GetMethod (MethodInfo fromNoninstanciated)
+{
+return GetCorrespondingInflatedMethod (fromNoninstanciated.MethodHandle.Value);
+}
+
+		internal override ConstructorInfo GetConstructor (ConstructorInfo fromNoninstanciated)
+		{
+return GetCorrespondingInflatedConstructor (fromNoninstanciated.MethodHandle.Value);
+		}
+
+		internal override FieldInfo GetField (FieldInfo fromNoninstanciated)
+		{
+return GetCorrespondingInflatedField (fromNoninstanciated.FieldHandle.Value);
+		}
+
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
 		public extern override Type GetNestedType (string name, BindingFlags bindingAttr);
 
 		[MethodImplAttribute(MethodImplOptions.InternalCall)]
Index: class/corlib/System.Reflection.Emit/FieldBuilder.cs
===
--- class/corlib/System.Reflection.Emit/FieldBuilder.cs	(wersja 45700)
+++ class/corlib/System.Reflection.Emit/FieldBuilder.cs	(kopia robocza)
@@ -80,7 +80,7 @@
 
 		public override RuntimeFieldHandle FieldHandle {
 			get {
-throw CreateNotSupportedException ();
+return handle;
 			}
 		}
 
Index: class/corlib/System.Reflection.Emit/ChangeLog
===
--- class/corlib/System.Reflection.Emit/ChangeLog	(wersja 45700)
+++ class/corlib/System.Reflection.Emit/ChangeLog	(kopia robocza)
@@ -1,3 +1,11 @@
+2005-06-09  Kamil Skalski [EMAIL PROTECTED]
+	* ConstructorBuilder.cs FieldBuilders.cs MethodBuilder.cs: Return
+	RuntimeHandles when requested
+	
+	* TypeBuilder.cs: Add static Get{Method,Constructor,Field} methods
+	from .NET 2.0 beta 2 API for obtaining instanciated 

Re: [Mono-devel-list] [PATCH] TypeBuilder.GetMethod and other updates for .NET 2.0 beta2 API

2005-06-08 Thread Kamil Skalski
Dnia roda, 8 czerwca 2005 17:31, Martin Baulig napisa:
 On Wed, 2005-06-08 at 15:50 +0200, Kamil Skalski wrote:
  I'm attaching our patch which updates mono with changes and additions in
  .NET 2.0 beta 2.
 
  There are some cosmetics changes of API, but most of the patch is related
  to TypeBuilder static methods, which are used for obtaining instanciated
  version of given MethodInfo (of Constructor / Field Info).

 Hello,

 thanks a lot for implementing this, it was next on my TODO list :-)

 The patch looks good, can you please commit ?


Ah, great. It is nice that the new API will be included in upcoming release.
I don't have svn access, so somebody should commit this, please :-)

-- 
Kamil Skalski
http://nazgul.omega.pl
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] [PATCH] TypeBuilder.GetMethod and other updates for .NET 2.0 beta2 API

2005-06-08 Thread Martin Baulig
Hello,

I'll commit it tomorrow morning.

Don't worry, we're waiting with the release to get a few more of my
fixes in, so this'll definitely go in :-)

Martin


On Wed, 2005-06-08 at 22:18 +0200, Kamil Skalski wrote:
 Dnia roda, 8 czerwca 2005 17:31, Martin Baulig napisa:
  On Wed, 2005-06-08 at 15:50 +0200, Kamil Skalski wrote:
   I'm attaching our patch which updates mono with changes and additions in
   .NET 2.0 beta 2.
  
   There are some cosmetics changes of API, but most of the patch is related
   to TypeBuilder static methods, which are used for obtaining instanciated
   version of given MethodInfo (of Constructor / Field Info).
 
  Hello,
 
  thanks a lot for implementing this, it was next on my TODO list :-)
 
  The patch looks good, can you please commit ?
 
 
 Ah, great. It is nice that the new API will be included in upcoming release.
 I don't have svn access, so somebody should commit this, please :-)
 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list