[Mono-bugs] [Bug 71486][Nor] New - Generics IL Error (2)

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 19 Jan 2005 16:42:17 -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=71486

--- shadow/71486	2005-01-19 16:42:17.000000000 -0500
+++ shadow/71486.tmp.4336	2005-01-19 16:42:17.000000000 -0500
@@ -0,0 +1,94 @@
+Bug#: 71486
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: Gentoo 2.6.7
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: spigaz@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Generics IL Error (2)
+
+Description of Problem:
+Another problem of generics when the generic type is an interface.
+
+Steps to reproduce the problem:
+1. Insert into a file
+
+namespace FLMID.Bugs.ILTwo
+{
+
+	public class Hashtable<K,V>
+
+	{
+
+		protected System.Collections.Hashtable _hashtable = new
+System.Collections.Hashtable();
+
+
+
+		public V this[K key]
+
+		{
+
+			get
+
+			{
+				return (V)_hashtable[key];
+
+			}
+
+			set
+
+			{
+
+				_hashtable[key] = value;
+
+			}
+
+		}
+
+	}
+
+	public interface IA
+	{
+	}
+	public class A : IA
+	{
+	}
+	public class Test
+	{
+		public static void Main(string[] args)
+		{
+			
+			Hashtable<string, IA> _hash = new Hashtable<string, IA>();
+		
+			_hash["test"] = new A();
+		
+			System.Console.WriteLine("Hello " + _hash["test"]);
+		}		
+	}
+}
+ 
+2. compile it
+3. run it
+
+Actual Results:
+** ERROR **: Invalid IL code at IL001b in
+FLMID.Bugs.ILTwo.Hashtable`2:get_Item (string): IL_001b: nop
+
+Expected Results:
+Hello FLMID.Bugs.ILTwo.A
+
+How often does this happen? 
+Always
+
+Additional Information:
+I tested it in the .Net 2.0 (beta) and it worked fine.