On Tue, Oct 6, 2020 at 6:59 PM Rowan Tommins <rowan.coll...@gmail.com>
wrote:

> On Tue, 6 Oct 2020 at 17:20, Andreas Leathley <a.leath...@gmx.net> wrote:
>
> > From my understanding suppressing the validation errors in this
> > particular case would be a good solution, or are there any serious
> > downsides to that?
> >
>
>
> The downside presumably is that a library author could implement an
> attribute with a property-only restriction, and therefore write code
> handling parameter attributes with the assumption that that attribute won't
> be present. If a consumer of the library makes use of constructor property
> promotion, that assumption can be violated. I can't quite picture what that
> code would look like, though, since it's always necessary to filter the
> list of attributes to exclude those from other libraries.
>

Yeah, this is my own view as well. If an attribute appears in an unexpected
place, you'd just ignore it the same way you ignore all attributes you do
not "own". For manual implementations, you wouldn't even notice (because
for a property-only attribute, you'd only be looking at properties, duh)
and general attribute handling libraries can easily accommodate this case
(if it doesn't just happen automatically).

Regards,
Nikita

Reply via email to