[Mono-bugs] [Bug 52499][Wis] New - Compiling a program with CS0110 results in a nullref

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 5 Jan 2004 18:00:39 -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 miguel@ximian.com.

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

--- shadow/52499	2004-01-05 18:00:39.000000000 -0500
+++ shadow/52499.tmp.11532	2004-01-05 18:00:39.000000000 -0500
@@ -0,0 +1,48 @@
+Bug#: 52499
+Product: Mono/Compilers
+Version: unspecified
+OS: unknown
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Compiling a program with CS0110 results in a nullref
+
+public class T {
+	public const int a = b + 1;
+	public const int b = a + 1;
+
+	public static void Main()
+	{
+	}
+}
+
+we get a nullref:
+
+Unhandled Exception: System.NullReferenceException: Object reference not 
+set to
+an instance of an object.
+   at Mono.CSharp.Const.LookupConstantValue()
+   at Mono.CSharp.TypeContainer.EmitConstants()
+   at Mono.CSharp.RootContext.EmitCode()
+   at Mono.CSharp.Driver.MainDriver(String[] args)
+   at Mono.CSharp.Driver.Main(String[] args)
+
+------- Additional Comments From pcgod@gmx.net  2003-12-23 21:41 -------
+the reason for this is in const.cs on line 197 which is:
+in_transit = false;
+
+in_transit is private bool (no property) so its normally not possible 
+for it to cause a null ref exception... (and no, the line number is 
+not incorrect, because it works with that line commented out)
+
+------- Additional Comments From miguel@ximian.com  2004-01-05 18:00 -------
+Fixed.