[PHP-DEV] Re: Attributes and constructor property promotion

2020-10-06 Thread Nikita Popov
On Mon, Sep 28, 2020 at 12:36 PM Nikita Popov wrote: > Hi internals, > > When the constructor property promotion landed, the question of how it > interacts with attributes on promoted properties did not get fully > resolved. See https://wiki.php.net/rfc/constructor_promotion#attributes > for what

Re: [PHP-DEV] Re: Attributes and constructor property promotion

2020-09-30 Thread Nikita Popov
On Wed, Sep 30, 2020 at 2:13 PM Nicolas Grekas wrote: > > > Le mer. 30 sept. 2020 à 12:45, Nikita Popov a > écrit : > >> On Tue, Sep 29, 2020 at 3:57 PM Benjamin Eberlei >> wrote: >> >> > On Tue, Sep 29, 2020 at 3:45 PM Larry Garfield >> > wrote: >> > >> > > On Mon, Sep 28, 2020, at 12:06 PM,

Re: [PHP-DEV] Re: Attributes and constructor property promotion

2020-09-30 Thread Nicolas Grekas
Le mer. 30 sept. 2020 à 12:45, Nikita Popov a écrit : > On Tue, Sep 29, 2020 at 3:57 PM Benjamin Eberlei > wrote: > > > On Tue, Sep 29, 2020 at 3:45 PM Larry Garfield > > wrote: > > > > > On Mon, Sep 28, 2020, at 12:06 PM, Benjamin Eberlei wrote: > > > > On Mon, Sep 28, 2020 at 4:35 PM Benjamin

Re: [PHP-DEV] Re: Attributes and constructor property promotion

2020-09-30 Thread Dik Takken
On 30-09-2020 12:45, Nikita Popov wrote: > So, as there seems to be resistance to applying the attribute to properties > only I only see a couple of options: > > 1. Forbid combining attributes and promotion. That means we can still decide to allow it later, right? Which gives us more time to thin

Re: [PHP-DEV] Re: Attributes and constructor property promotion

2020-09-30 Thread Nikita Popov
On Tue, Sep 29, 2020 at 3:57 PM Benjamin Eberlei wrote: > On Tue, Sep 29, 2020 at 3:45 PM Larry Garfield > wrote: > > > On Mon, Sep 28, 2020, at 12:06 PM, Benjamin Eberlei wrote: > > > On Mon, Sep 28, 2020 at 4:35 PM Benjamin Morel < > benjamin.mo...@gmail.com > > > > > > wrote: > > > > > > > On

Re: [PHP-DEV] Re: Attributes and constructor property promotion

2020-09-29 Thread Benjamin Eberlei
On Tue, Sep 29, 2020 at 3:45 PM Larry Garfield wrote: > On Mon, Sep 28, 2020, at 12:06 PM, Benjamin Eberlei wrote: > > On Mon, Sep 28, 2020 at 4:35 PM Benjamin Morel > > > wrote: > > > > > On Mon, 28 Sep 2020 at 15:17, Nicolas Grekas < > nicolas.grekas+...@gmail.com> > > > wrote: > > > > > >> I

Re: [PHP-DEV] Re: Attributes and constructor property promotion

2020-09-29 Thread Larry Garfield
On Mon, Sep 28, 2020, at 12:06 PM, Benjamin Eberlei wrote: > On Mon, Sep 28, 2020 at 4:35 PM Benjamin Morel > wrote: > > > On Mon, 28 Sep 2020 at 15:17, Nicolas Grekas > > wrote: > > > >> I assume the 80% case is properties, because attributes did not have > >>> docblock annotations yet, that me

Re: [PHP-DEV] Re: Attributes and constructor property promotion

2020-09-28 Thread Benjamin Eberlei
On Mon, Sep 28, 2020 at 4:35 PM Benjamin Morel wrote: > On Mon, 28 Sep 2020 at 15:17, Nicolas Grekas > wrote: > >> 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

Re: [PHP-DEV] Re: Attributes and constructor property promotion

2020-09-28 Thread Benjamin Morel
On Mon, 28 Sep 2020 at 15:17, Nicolas Grekas wrote: > 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,

Re: [PHP-DEV] Re: Attributes and constructor property promotion

2020-09-28 Thread Nicolas Grekas
> > >> 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 > > consi

Re: [PHP-DEV] Re: Attributes and constructor property promotion

2020-09-28 Thread Benjamin Eberlei
On Mon, Sep 28, 2020 at 2:25 PM Benjamin Morel wrote: > On Mon, 28 Sep 2020 at 13:56, Benjamin Eberlei > 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

Re: [PHP-DEV] Re: Attributes and constructor property promotion

2020-09-28 Thread Benjamin Morel
On Mon, 28 Sep 2020 at 13:56, Benjamin Eberlei 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 ca

[PHP-DEV] Re: Attributes and constructor property promotion

2020-09-28 Thread Benjamin Eberlei
On Mon, Sep 28, 2020 at 12:36 PM Nikita Popov wrote: > Hi internals, > > When the constructor property promotion landed, the question of how it > interacts with attributes on promoted properties did not get fully > resolved. See https://wiki.php.net/rfc/constructor_promotion#attributes > for what