On Tue, 23 Mar 2021 at 19:45, Matthew Brown <matthewmatt...@gmail.com>
wrote:

> On Tue, 23 Mar 2021 at 05:32, G. P. B. <george.bany...@gmail.com> wrote:
>
>> I'm calling this proposal pure intersection types as there would be no
>> possibility of mixing intersection and union types, I'm leaving this as a
>> future scope.
>>
>
> Does this miss an opportunity, though? It's useful to be able to write
> A&B|null.
>

Obviously this is less powerful than support for composite types where one
can use both intersections and unions.

I've tried implementing composite types without grouping here:
https://github.com/Girgias/php-src/pull/8
But I'm hitting various issues and I'm far from confident that I'll be able
to resolve them and add the variance check code before June so that this
can reasonably get voted in for PHP 8.1.

The end goal is support for composite types but I prefer to land a
reasonably self contained feature in 8.1 then nothing at all.
Internals might disagree with this and refuse the feature unless "complete"
but if that's the case there is still time to "finish" it for another RFC.

If someone else wants to work on adding support for composite types they
are free to work based on my PR, or collaborate with me.

I've also tidied up the RFC: https://github.com/Girgias/intersection-types

Unless someone shows up to work on composite types, I'll probably bring
this to a vote next week (if I don't forget about it).

Best regards,

George P. Banyard

Reply via email to