Re: [RFC] Union Types v2
| From: | Nikita Popov | Date: | Tue, 22 Oct 2019 09:36:07 +0000 |
| Subject: | Re: [RFC] Union Types v2 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-107626@lists.php.net to get a copy of this message | ||
On Wed, Sep 4, 2019 at 10:26 AM Nikita Popov <nikita.ppv@gmail.com> wrote:
> Hi internals,
>
> I'd like to start the discussion on union types again, with a new proposal:
>
> Pull Request: https://github.com/php/php-rfcs/pull/1
> Rendered Proposal:
>
> https://github.com/nikic/php-rfcs/blob/union-types/rfcs/0000-union-types-v2.md
>
> As an experiment, I'm submitting this RFC as a GitHub pull request, to
> evaluate whether this might be a better medium for RFC proposals in the
> future. It would be great if we could keep the discussion to the GitHub
> pull request for the purpose of this experiment (keep in mind that you can
> also create comments on specific lines in the proposal, not just the
> overall discussion thread!) Of course, you can also reply to this mail
> instead. The final vote will be held in the wiki as usual.
>
> Relatively to the previous proposal by Bob&Levi (
> https://wiki.php.net/rfc/union_types), I think the main
> differences in
> this proposal are:
> * Updated to specify interaction with new language features, like full
> variance and property types.
> * Updated for the use of the ?Type syntax rather than the Type|null
> syntax.
> * Only supports "false" as a pseudo-type, not "true".
> * Slightly simplified semantics for the coercive typing mode.
>
> Regards,
> Nikita
>
An implementation of this proposal is now available at
https://github.com/php/php-src/pull/4838. As
the implementation didn't turn
up any new issues, I think it's time to move this RFC forward to voting.
Nikita