// Martin Baulig (martin@ximian.com)
// Raja R Harinath (rharinath@novell.com)
//
-// (C) 2001, 2002, 2003 Ximian, Inc.
+// Copyright 2001, 2002, 2003 Ximian, Inc.
+// Copyright 2003-2008 Novell, Inc.
//
using System;
protected abstract UsageVector Merge ();
- // <summary>
- // Merge a child branching.
- // </summary>
public UsageVector MergeChild (FlowBranching child)
{
- bool overwrite = false;
-
- switch (child.Type) {
- case BranchingType.Labeled:
- overwrite = true;
- break;
- case BranchingType.Block:
- if (child.Block != null && child.Block != child.Block.Explicit)
- overwrite = true;
- break;
- }
-
- Report.Debug (2, " MERGING CHILD", this, child);
- UsageVector result = CurrentUsageVector.MergeChild (child.Merge (), overwrite);
- Report.Debug (2, " MERGING CHILD DONE", this, result);
- return result;
+ return CurrentUsageVector.MergeChild (child.Merge (), true);
}
public virtual bool CheckRethrow (Location loc)
FieldInfo field = struct_info.Fields [i];
if (!branching.IsFieldAssigned (vi, field.Name)) {
- Report.Error (171, loc,
- "Field `{0}' must be fully assigned before control leaves the constructor",
- TypeManager.GetFullNameSignature (field));
+ FieldBase fb = TypeManager.GetField (field);
+ if (fb != null && (fb.ModFlags & Modifiers.BACKING_FIELD) != 0) {
+ Report.Error (843, loc,
+ "An automatically implemented property `{0}' must be fully assigned before control leaves the constructor. Consider calling default contructor",
+ fb.GetSignatureForError ());
+ } else {
+ Report.Error (171, loc,
+ "Field `{0}' must be fully assigned before control leaves the constructor",
+ TypeManager.GetFullNameSignature (field));
+ }
ok = false;
}
}