[Mono-bugs] [Bug 74751][Wis] New - NullRef on a ABI change rather than assert

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 27 Apr 2005 13:19:09 -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 bmaurer@users.sf.net.

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

--- shadow/74751	2005-04-27 13:19:09.000000000 -0400
+++ shadow/74751.tmp.22313	2005-04-27 13:19:09.000000000 -0400
@@ -0,0 +1,51 @@
+Bug#: 74751
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: NullRef on a ABI change rather than assert
+
+Compile this test case:
+
+#if A
+public class X {
+	#if B
+		public static readonly string blah = "FOO";
+	#else
+		public const string blah = "FOO";
+	#endif
+}
+#else
+class Y {
+	static void Main () {
+		System.Console.WriteLine (X.blah);
+	}
+}
+#endif
+
+like:
+
+[benm@omega benm]$ mcs foo.cs /out:blah.dll /t:library /d:A,B
+[benm@omega benm]$ mcs foo.cs /r:blah.dll
+[benm@omega benm]$ mono foo.exe
+FOO
+[benm@omega benm]$ mcs foo.cs /out:blah.dll /t:library /d:A
+[benm@omega benm]$ mono foo.exe
+ 
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x00008> Y:Main ()
+
+On MSFT you get a missingfieldexception. At the very least, we should
+assert, rather than a strange NRE.