On Thu, Apr 2, 2020 at 3:47 PM Markus Fischer <mar...@fischer.name> wrote:

> Him
>
> On 02.04.20 12:07, Nikita Popov wrote:
> > Reflection will see the state after desugaring. That is, it just sees
> > normal properties and normal constructor args. I've made this more
> explicit
> > in the RFC now:
> https://wiki.php.net/rfc/constructor_promotion#reflection
>
> Thanks!
>
> Another one, also related a bit to your PHP-Parser (?): will the
> tokenization process "see" the code before desugaring?
>
> I'm wondering how automated translation tool can detect that a certain
> code is not "sugared" and promote this?
>

Tokenization and parsing both happen before the desugaring, they see the
code in its original form. They would detect promoted properties by
checking whether a constructor parameter has a visibility modifier.  Of
course, tooling might want to perform the desugaring transformation
internally, so it sees a uniform representation of everything.

Regards,
Nikita

Reply via email to