// 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;
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;
}
}