Bug 321397 (MONO78673) - [G]MCS doesn't stop on error CS0246
Summary: [G]MCS doesn't stop on error CS0246
Status: RESOLVED FIXED
Alias: MONO78673
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Minor
Target Milestone: ---
Assignee: Raja R Harinath
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-19 18:08 UTC by Petri Latvala
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:01:44 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".