Bugzilla – Bug 321397
[G]MCS doesn't stop on error CS0246
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by adrinael@adrinael.net 2006-06-19 11:08:24 MST ---- Description of Problem: Testcase: public class foo { private unexistingclassname field = null; } Compiling that generates: missing.cs(3,11): error CS0246: The type or namespace name `unexistingclassname' could not be found. Are you missing a using directive or an assembly reference? (which is correct output) and after that prints: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at Mono.CSharp.FieldExpr..ctor (System.Reflection.FieldInfo fi, Location l) [0x00000] at Mono.CSharp.FieldExpr..ctor (System.Reflection.FieldInfo fi, Location l, Boolean in_initializer) [0x00000] at Mono.CSharp.FieldBase.ResolveInitializer () [0x00000] at Mono.CSharp.ClassOrStruct.DefineFieldInitializers () [0x00000] at Mono.CSharp.ClassOrStruct.Define () [0x00000] at Mono.CSharp.RootContext.DefineTypes () [0x00000] at Mono.CSharp.Driver.MainDriver (System.String[] args) [0x00000] at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] Steps to reproduce the problem: 1. Write above code to a file 2. Compile with gmcs or mcs (happens with both) Actual Results: Above printout; nullreference exception. Expected Results: Only the error message. How often does this happen? Always. Additional Information: svn HEAD from 2006-06-18 is the version used. ---- Additional Comments From rharinath@novell.com 2006-06-21 09:24:53 MST ---- Should be fixed in SVN r61901. Unknown operating system unknown. Setting to default OS "Other".