Mono.CSharp.Report.Warning C# (CSharp) Method

Warning() public method

public Warning ( int code, int level, Mono.CSharp.Location loc, string message ) : void
code int
level int
loc Mono.CSharp.Location
message string
return void
		public void Warning (int code, int level, Location loc, string message)
		{
			if (reporting_disabled > 0)
				return;

			if (!IsWarningEnabled (code, level, loc))
				return;

			AbstractMessage msg;
			if (IsWarningAsError (code))
				msg = new ErrorMessage (code, loc, message, extra_information);
			else
				msg = new WarningMessage (code, loc, message, extra_information);

			extra_information.Clear ();
			printer.Print (msg);
		}

Same methods

Report::Warning ( int code, int level, Mono.CSharp.Location loc, string format, string arg ) : void
Report::Warning ( int code, int level, Mono.CSharp.Location loc, string format, string arg1, string arg2 ) : void
Report::Warning ( int code, int level, string message ) : void
Report::Warning ( int code, int level, string format, string arg ) : void
Report::Warning ( int code, int level, string format, string arg1, string arg2 ) : void

Usage Example

Example #1
0
        protected override bool CheckBase()
        {
            if (!base.CheckBase())
            {
                return(false);
            }

            MemberSpec candidate;
            bool       overrides       = false;
            var        conflict_symbol = MemberCache.FindBaseMember(this, out candidate, ref overrides);

            if (conflict_symbol == null)
            {
                conflict_symbol = candidate;
            }

            if (conflict_symbol == null)
            {
                if ((ModFlags & Modifiers.NEW) != 0)
                {
                    Report.Warning(109, 4, Location, "The member `{0}' does not hide an inherited member. The new keyword is not required",
                                   GetSignatureForError());
                }
            }
            else
            {
                if ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE | Modifiers.BACKING_FIELD)) == 0)
                {
                    Report.SymbolRelatedToPreviousError(conflict_symbol);
                    Report.Warning(108, 2, Location, "`{0}' hides inherited member `{1}'. Use the new keyword if hiding was intended",
                                   GetSignatureForError(), conflict_symbol.GetSignatureForError());
                }

                if (conflict_symbol.IsAbstract)
                {
                    Report.SymbolRelatedToPreviousError(conflict_symbol);
                    Report.Error(533, Location, "`{0}' hides inherited abstract member `{1}'",
                                 GetSignatureForError(), conflict_symbol.GetSignatureForError());
                }
            }

            return(true);
        }
All Usage Examples Of Mono.CSharp.Report::Warning