Exemplo n.º 1
0
        public override string GetSignatureForError()
        {
            if (Name == null)
            {
                return(field.GetSignatureForError());
            }

            return(field.Parent.GetSignatureForError() + "." + Name);
        }
Exemplo n.º 2
0
		public bool AddField (FieldBase field)
		{
			AddMember (field);

			if ((field.ModFlags & Modifiers.STATIC) != 0)
				return true;

			var first_field = PartialContainer.first_nonstatic_field;
			if (first_field == null) {
				PartialContainer.first_nonstatic_field = field;
				return true;
			}

			if (Kind == MemberKind.Struct && first_field.Parent != field.Parent) {
				Report.SymbolRelatedToPreviousError (first_field.Parent);
				Report.Warning (282, 3, field.Location,
					"struct instance field `{0}' found in different declaration from instance field `{1}'",
					field.GetSignatureForError (), first_field.GetSignatureForError ());
			}
			return true;
		}
Exemplo n.º 3
0
void case_107()
#line 1005 "cs-parser.jay"
{
		var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
		var mod = (Modifiers) yyVals[-3+yyTop];
		current_field = new Const (current_type, (FullNamedExpression) yyVals[-1+yyTop], mod, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]);
		current_type.AddMember (current_field);
		
		if ((mod & Modifiers.STATIC) != 0) {
			report.Error (504, current_field.Location, "The constant `{0}' cannot be marked static", current_field.GetSignatureForError ());
		}
		
		yyVal = current_field;
	  }