- value = (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 (parent_enum.UnderlyingType));
- return false;
- }
- in_transit = false;
-
- return true;
- }
-
- public override void Emit ()
- {
- if (OptAttributes != null)
- OptAttributes.Emit ();
-
- if (!ResolveValue ()) {
- // Suppress cyclic errors
- value = new EnumConstant(New.Constantify(parent_enum.UnderlyingType), parent_enum.TypeBuilder);
- return;
- }
-
- builder.SetConstant (value.GetValue ());
- base.Emit ();
- }
-
- public override string GetSignatureForError()
- {
- return String.Concat (parent_enum.GetSignatureForError (), '.', Name);
- }
-
- public override string[] ValidAttributeTargets {
- get {
- return attribute_targets;
- }
- }
-
- public override string DocCommentHeader {
- get { return "F:"; }
- }
-
- #region IConstant Members
-
- public Constant CreateConstantReference (Location loc)
- {
- if (value == null)
+ 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));