* driver.cs (Driver.MainDriver): Only report an error CS5001
if there were no compilation errors.
* codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
`UnsafeContext' property to determine whether the parent is in
unsafe context rather than checking the parent's ModFlags:
classes nested in an unsafe class are unsafe as well.
svn path=/trunk/mcs/; revision=6553
+2002-08-08 Martin Baulig <martin@gnome.org>
+
+ * driver.cs (Driver.MainDriver): Only report an error CS5001
+ if there were no compilation errors.
+
+ * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
+ `UnsafeContext' property to determine whether the parent is in
+ unsafe context rather than checking the parent's ModFlags:
+ classes nested in an unsafe class are unsafe as well.
+
2002-08-08 Martin Baulig <martin@gnome.org>
* statement.cs (UsageVector.MergeChildren): Distinguish between
if (parent != null){
// Can only be null for the ResolveType contexts.
- ContainerType = parent.TypeBuilder;
- InUnsafe = ((parent.ModFlags | code_flags) & Modifiers.UNSAFE) != 0;
+ ContainerType = parent.TypeBuilder;
+ if (parent.UnsafeContext)
+ InUnsafe = true;
+ else
+ InUnsafe = (code_flags & Modifiers.UNSAFE) != 0;
}
OnlyLookupTypes = false;
loc = l;
MethodInfo ep = RootContext.EntryPoint;
if (ep == null){
- Report.Error (5001, "Program " + output_file +
+ if (Report.Errors == 0)
+ Report.Error (5001, "Program " + output_file +
" does not have an entry point defined");
return false;
}