[Mono-bugs] [Bug 81951][Nor] New - Tricky generic code produces error while MS.NET does not

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Jun 26 11:04: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 knocte at gmail.com.

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

--- shadow/81951	2007-06-26 11:04:34.000000000 -0400
+++ shadow/81951.tmp.26886	2007-06-26 11:04:34.000000000 -0400
@@ -0,0 +1,54 @@
+Bug#: 81951
+Product: Mono: Compilers
+Version: 1.2
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: knocte at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Tricky generic code produces error while MS.NET does not
+
+Testcase is:
+
+using System.Collections.Generic;
+namespace gmcsGenericsBug
+{
+    public class BaseClass<T, O>
+    {
+        public class NestedClassInsideBaseClass<K, V>
+        {
+        }
+
+        public List<NestedClassInsideBaseClass<T, O>> Items
+        {
+            get { return null; }
+        }
+    }
+	
+    public class DerivedClass : BaseClass<int, string>
+    {
+        public DerivedClass()
+        {
+            foreach (NestedClassInsideBaseClass<int, string> oPair
+                     in this.Items)
+            {
+	    }
+        }
+    }
+}
+
+Results:
+Using the generic type
+`gmcsGenericsBug.BaseClass<T,O>.NestedClassInsideBaseClass<K,V>' requires 4
+type arguments (CS0305).
+
+Expected results (MS.NET):
+[No compilation errors.]


More information about the mono-bugs mailing list