[Mono-devel-list] Do we really need "related location" for CS0136?

Raja R Harinath rharinath at novell.com
Fri May 27 05:14:29 EDT 2005


Hi,

Atsushi Eno <atsushi at ximian.com> writes:

> I created a patch for mcs that 1) adds Location property to
> ParameterBase, and 2) removes Location property from Parameters.
> On Parameter class there was a comment:
>
> //TODO: Add location member to this or base class for better error
> location and all methods simplification.
>
> For Parameters.Location it is only used for CS0136 where IMHO
> we don't need "related location" information (since it must be
> always the exact declaration part). 

Hmm.  The error message says that the given variable declaration is
invalid since it shadows a parameter.  So, it's useful to point to the
exact parameter that's being shadowed.

> So I would suggest to just remove that reporting

So, no.

> but for now I just replaced Parameters.Location with the exact
> Location of related Parameter.

And, yes -- this is the right fix.  I used Parameters.Location since we
didn't have Parameter.Location.

- Hari



More information about the Mono-devel-list mailing list