[Mono-bugs] [Bug 71484][Wis] New - Generics IL Error (1)

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 19 Jan 2005 16:36:34 -0500 (EST)


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@gmail.com.

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

--- shadow/71484	2005-01-19 16:36:34.000000000 -0500
+++ shadow/71484.tmp.4223	2005-01-19 16:36:34.000000000 -0500
@@ -0,0 +1,82 @@
+Bug#: 71484
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: Gentoo 2.6.7
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: spigaz@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Generics IL Error (1)
+
+Description of Problem:
+Problem in the expansion of a generic type.
+
+
+Steps to reproduce the problem:
+1. Insert into a file:
+namespace FLMID.Bugs.ILOne
+{
+	public class B<T>
+
+	{
+
+		public int Add(T obj)
+
+		{
+			return -1;
+
+		}
+
+		public void AddRange(System.Collections.ICollection collection)
+
+		{
+
+			foreach(T obj in collection)
+
+				Add(obj);
+
+		}
+
+	}
+
+	public interface IA
+	{
+	}
+	public class A : IA
+	{
+	}
+	public class Test
+	{
+		public static void Main(string[] args)
+		{
+			B<IA> aux = new B<IA>();
+			aux.AddRange(new object[]{new A(), new A()});
+			System.Console.WriteLine("Sucess");
+		}		
+	}
+}
+
+2. Compile it
+3. Execute it
+
+Actual Results:
+** ERROR **: Invalid IL code at IL0025 in FLMID.Bugs.ILOne.B`1:AddRange
+(System.Collections.ICollection): IL_0025: pop
+
+
+Expected Results:
+Sucess
+
+How often does this happen? 
+Always
+
+Additional Information:
+Tested with .Net 2.0 (beta) and worked fine