Example #1
0
        protected bool CheckDeclaration(ErrorSink /*!*/ errors, IDeclaree /*!*/ member, Declaration /*!*/ existing)
        {
            Declaration current = member.Declaration;

            if (existing.IsPartial ^ current.IsPartial)
            {
                TryFixPartial(errors, current, existing);
                TryFixPartial(errors, existing, current);
            }

            if ((!existing.IsPartial || !current.IsPartial) && (!existing.IsConditional || !current.IsConditional))
            {
                // report fatal error (do not throw an exception, just don't let the analysis continue):
                member.ReportRedeclaration(errors);
                errors.Add(FatalErrors.RelatedLocation, existing.SourceUnit, existing.Span);
                return(false);
            }

            return(true);
        }
Example #2
0
		protected bool CheckDeclaration(ErrorSink/*!*/ errors, IDeclaree/*!*/ member, Declaration/*!*/ existing)
		{
			Declaration current = member.Declaration;

			if (existing.IsPartial ^ current.IsPartial)
			{
				TryFixPartial(errors, current, existing);
				TryFixPartial(errors, existing, current);
			}

			if ((!existing.IsPartial || !current.IsPartial) && (!existing.IsConditional || !current.IsConditional))
			{
				// report fatal error (do not throw an exception, just don't let the analysis continue):
				member.ReportRedeclaration(errors);
				errors.Add(FatalErrors.RelatedLocation, existing.SourceUnit, existing.Position);
				return false;
			}

			return true;
		}