[Mono-bugs] [Bug 74864][Nor] New - gmcs: NullReferenceException when compiling erroneous generic method

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 7 May 2005 14:07:10 -0400 (EDT)


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 i.kasiuk@ngi.de.

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

--- shadow/74864	2005-05-07 14:07:10.000000000 -0400
+++ shadow/74864.tmp.17874	2005-05-07 14:07:10.000000000 -0400
@@ -0,0 +1,45 @@
+Bug#: 74864
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: FC3 x86_64 on AMD64
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: i.kasiuk@ngi.de               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: gmcs: NullReferenceException when compiling erroneous generic method
+
+Compile the following code with gmcs:
+
+-----------------------------------------------
+class Test
+{
+    void f<T>(T t) where T : T1 { }
+    public static void Main() { }
+}
+-----------------------------------------------
+
+This shouldn't compile as T1 is undefinded. But I didn't expect gmcs to
+throw an exception:
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x0001c> Mono.CSharp.Method:Emit ()
+in <0x00685> Mono.CSharp.TypeContainer:EmitType ()
+in <0x00249> Mono.CSharp.RootContext:EmitCode ()
+in <0x00bd3> Mono.CSharp.Driver:MainDriver (System.String[] args)
+in <0x0001f> Mono.CSharp.Driver:Main (System.String[] args)
+
+
+Expected Results:
+error message
+
+How often does this happen? 
+always