[Mono-bugs] [Bug 27623][Nor] New - Compiler gives odd response to a logic error

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
10 Jul 2002 23:11:13 -0000


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 kellyrocks@softhome.net.

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

--- shadow/27623	Wed Jul 10 19:11:13 2002
+++ shadow/27623.tmp.26596	Wed Jul 10 19:11:13 2002
@@ -0,0 +1,75 @@
+Bug#: 27623
+Product: Mono/MCS
+Version: unspecified
+OS: Red Hat 7.2
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: kellyrocks@softhome.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Compiler gives odd response to a logic error
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+
+I came across this compiler error when I made a very silly mistake in my 
+logic while seeing what I could do with the new improved Mono.
+
+Here is a sample of what kind of code I was trying to compile:
+
+using System;
+using CustomAssembly;
+
+namespace App
+{
+    public class App
+    {
+        CustomClass blah = new CustomClass();
+
+        static void Main()
+        {
+            blah.Username = "test"; //This is the logic mistake
+            Console.WriteLine("Test");
+        }
+    }
+}
+
+Actual Results:
+Here is the mcs compile results:
+
+(process:29973): ** WARNING **: unhandled exception 
+System.NullReferenceException: "A null value was found where an object 
+instance was required"
+in <0x0016b> Mono.CSharp.FieldExpr:Emit (Mono.CSharp.EmitContext)
+in <0x003c5> Mono.CSharp.Invocation:EmitCall 
+(Mono.CSharp.EmitContext,bool,bool,Mono.CSharp.Expression,System.Reflectio
+n.MethodBase,System.Collections.ArrayList,Mono.CSharp.Location)
+in <0x000d3> Mono.CSharp.PropertyExpr:EmitAssign 
+(Mono.CSharp.EmitContext,Mono.CSharp.Expression)
+in <0x0012a> Mono.CSharp.Assign:Emit (Mono.CSharp.EmitContext,bool)
+in <0x00015> Mono.CSharp.Assign:EmitStatement (Mono.CSharp.EmitContext)
+in <0x00078> Mono.CSharp.StatementExpression:Emit 
+(Mono.CSharp.EmitContext)
+in <0x0023f> Mono.CSharp.Block:Emit (Mono.CSharp.EmitContext)
+in <0x000ac> Mono.CSharp.EmitContext:EmitTopBlock 
+(Mono.CSharp.Block,Mono.CSharp.Location)
+in <0x00403> Mono.CSharp.Method:Emit (Mono.CSharp.TypeContainer)
+in <0x001df> Mono.CSharp.TypeContainer:Emit ()
+in <0x004c3> Mono.CSharp.RootContext:EmitCode ()
+in <0x018e6> Mono.CSharp.Driver:MainDriver (string[])
+in <0x0000b> Mono.CSharp.Driver:Main (string[])
+
+Expected Results:
+Maybe a nicer error outputted so the person can understand the mistake 
+they did?
+
+How often does this happen? 
+Every time.