On Mon, Sep 28, 2020 at 2:25 PM Benjamin Morel <benjamin.mo...@gmail.com>
wrote:

>   On Mon, 28 Sep 2020 at 13:56, Benjamin Eberlei <kont...@beberlei.de>
> wrote:
>
>
>> imho, we should pick the 80% use-case and advise to desugar the code if
>> other behavior is desired. For me the 80% case is that the attribute only
>> applies to the property, not to the parameter.
>
>
> +1 for the desugaring advice in this case, however as a matter of
> consistency I'd rather have it either apply to both the property and the
> parameter, or just throw an exception if used on promoted properties,
> whatever the 80% use-case is (source?)
>

We should assume that there are very few attributes that make sense to
apply to *both* a property and an argument. I can't find any good example
where this makes sense.

Library developers shouldn't be forced to allow target argument only that
it works in the ctor promotion case.

I assume the 80% case is properties, because attributes did not have
docblock annotations yet, that means this use-case isn't even possible at
the moment. Yet annotations on properties are widespread (Doctrine ORM,
symfony validator, ...).


> Kind regards,
> — Benjamin
>

Reply via email to