- value = prev_member.value.Increment ();
- }
- catch (OverflowException) {
- Report.Error (543, Location, "The enumerator value `{0}' is too large to fit in its type `{1}'",
- GetSignatureForError (), TypeManager.CSharpName (parent_enum.UnderlyingType));
- return false;
- }
- in_transit = false;
-
- return true;
- }
-
- public bool Emit (EmitContext ec)
- {
- if (OptAttributes != null)
- OptAttributes.Emit (ec, this);
-
- if (!ResolveValue ())
- return false;
-
- builder.SetConstant (value.GetValue ());
- Emit ();
- return true;
- }
-
- public override string GetSignatureForError()
- {
- return String.Concat (parent_enum.GetSignatureForError (), '.', Name);
- }
-
- public override string[] ValidAttributeTargets {
- get {
- return attribute_targets;
- }
- }
-
- protected override bool VerifyClsCompliance(DeclSpace ds)
- {
- // Because parent is TypeContainer and we have only DeclSpace parent.
- // Parameter replacing is required
- return base.VerifyClsCompliance (parent_enum);
- }
-
- public override string DocCommentHeader {
- get { return "F:"; }
- }
-
- #region IConstant Members
-
- public Constant Value {
- get {
- return value;
+ return (EnumConstant) prev_member.value.Increment ();
+ } catch (OverflowException) {
+ Report.Error (543, Location, "The enumerator value `{0}' is too " +
+ "large to fit in its type `{1}'", GetSignatureForError (),
+ TypeManager.CSharpName (ParentEnum.UnderlyingType));
+ return null;