[Mono-bugs] [Bug 82639][Nor] New - [2.0] Type.GetMethod should raise AmbiguousMatchException

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Aug 30 14:02:34 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by robertj at gmx.net.

http://bugzilla.ximian.com/show_bug.cgi?id=82639

--- shadow/82639	2007-08-30 14:02:34.000000000 -0400
+++ shadow/82639.tmp.19789	2007-08-30 14:02:34.000000000 -0400
@@ -0,0 +1,54 @@
+Bug#: 82639
+Product: Mono: Class Libraries
+Version: 1.2
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: robertj at gmx.net               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [2.0] Type.GetMethod should raise AmbiguousMatchException
+
+Type.GetMethod incorrectly returns the first generic method
+instead of raising AmbiguousMatchException. Works (and it also happens
+to makes sense) on MS.NET 2.0.
+
+
+using System;
+using System.Reflection;
+
+class Test
+{
+	public void Method (int i)
+	{
+	}
+
+	public void Method <T> (int i)
+	{
+	}
+
+	public void Method <T, V> (int i)
+	{
+	}
+
+	static void Main ()
+	{
+		Type[] sig = new Type [] { typeof (int) };
+		BindingFlags flags = BindingFlags.Instance | BindingFlags.Public;
+
+		try {
+			Console.WriteLine(typeof (Test).GetMethod ("Method", flags, null, sig,
+null));
+			Console.WriteLine ("should not happen");
+		} catch (AmbiguousMatchException) {
+			Console.WriteLine ("ok");
+		}
+	}
+}


More information about the mono-bugs mailing list