[Mono-bugs] [Bug 75093][Nor] New - Strange Generic Bug while reporting inadequate delegate

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun May 29 22:18:57 EDT 2005


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 spigaz at gmail.com.

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

--- shadow/75093	2005-05-29 22:18:57.000000000 -0400
+++ shadow/75093.tmp.31911	2005-05-29 22:18:57.000000000 -0400
@@ -0,0 +1,73 @@
+Bug#: 75093
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: Gentoo 2.6.11
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: spigaz at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Strange Generic Bug while reporting inadequate delegate
+
+Description of Problem:
+
+In a strange configuration the gmcs flags a wrong error.
+
+Steps to reproduce the problem:
+1. Insert into a file and compile into an assembly:
+public class Generic<T>
+
+{
+	public void Add(Changed changed)
+
+	{
+
+	}
+
+	public delegate void Changed(Generic<T> proxy, T value);
+
+}
+
+public class Class
+{
+	public Generic<bool> Property
+	{
+		get
+		{
+			return null;
+		}
+	}
+}
+2. Insert into another file and compile with the other assembly as reference:
+public class Class2
+{	
+	public Class2(Class instance)
+	{
+		instance.Property.Add(new Generic<bool>.Changed(OnEvent));
+	}
+	protected void OnEvent(object changed)
+	{
+	}
+}
+3. 
+
+Actual Results:
+error CS0234: The type name `Changed' could not be found in type
+`Generic`1<T><System.Boolean>'
+
+Expected Results:
+error CS0123: Method 'void Class2.OnEvent ( object)' does not match
+delegate 'void Generic`1+Changed<System.Boolean> (Generic`1, bool)'
+
+How often does this happen? 
+Always
+
+Additional Information:
+Might be related to bug 75092


More information about the mono-bugs mailing list