[Mono-bugs] [Bug 77527][Nor] New - [GMCS] Cannot compile generics anonymous method

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Feb 10 18:57:23 EST 2006


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 marek.safar at seznam.cz.

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

--- shadow/77527	2006-02-10 18:57:23.000000000 -0500
+++ shadow/77527.tmp.4849	2006-02-10 18:57:23.000000000 -0500
@@ -0,0 +1,79 @@
+Bug#: 77527
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: marek.safar at seznam.cz               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [GMCS] Cannot compile generics anonymous method
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+
+Steps to reproduce the problem:
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace A
+{
+    public class StringEnum
+    {
+        public readonly string Value;
+		readonly string[] aliases;
+ 
+        protected StringEnum(string v)
+        {
+            Value = v;
+        }
+
+        protected static T Parse<T>(string value, params T[] args) where T
+: StringEnum
+        {
+            T item = Array.Find<T>(args, delegate(T t)
+            {
+                if (t.Value == value)
+                    return true;
+
+                return Array.Exists<string>(t.aliases, delegate (string s)
+                {
+                    return s == value;
+                });
+            });
+
+ 
+            if (item == null)
+                throw new ArgumentOutOfRangeException("value", value);
+
+            return item;
+        }
+    }
+}
+
+
+Actual Results:
+
+(19,15): error CS0029: Cannot implicitly convert type `System.Nullable<T
+>' to `T'
+
+Expected Results:
+
+No error (except CS5001)
+
+How often does this happen? 
+
+100%
+
+Additional Information:


More information about the mono-bugs mailing list