Re: [RFC] Nullable intersection types

From: Date: Fri, 23 Jul 2021 14:30:45 +0000
Subject: Re: [RFC] Nullable intersection types
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-115562@lists.php.net to get a copy of this message
On Fri, Jul 23, 2021 at 2:36 PM Derick Rethans <derick@php.net> wrote: > From the RFC: «Taking all these elements into account, the preference > of... and thus to use the "?X&Y" syntax». > > I think this would be a mistake. You touch upon operator precedence, and > needing to know whether | or & is higher, and inventing a new precedence > for ?. > > I would strongly advocate for not getting into the realm with any > operator precendence, but instead *require* parenthesis for any > combination. This gives the code reader and writer an immediate clue > about what the code does. Most coding standards also recommend this for > expressions in "if" statements and the like. > > I do however agree with Sara's «over-delivering syntax that hasn't been > entirely thought through» point. It will take a lot longer to come up > with a proposal to combine intersection and union types. > > That in combination that you're proposing this RFC after feature freeze, > while you've had four months to make this arguments as part of the "Pure > Intersection Types" RFC, I am currently not going to support this RFC > for inclusion into PHP 8.1. > > cheers, > Derick > > -- > PHP 7.4 Release Manager > Host of PHP Internals News: https://phpinternals.news > Like Xdebug? Consider supporting me: https://xdebug.org/support > https://derickrethans.nl | > https://xdebug.org | https://dram.io > twitter: @derickr and @xdebug > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php These are precisely everything I think about this RFC. The only thing the RFC made clear is why it is easy to make an exception for null while still not providing a full mix of union and intersection. Maybe my memory is also really bad, but the RFC makes it seem like version 7.0 was a mistake to be learned from which isn't clear for me. I understand that introducing nullable intersection later will warrant a major version and I don't see a problem with that. Pure Intersection RFC was such a breeze vote precisely because it didn't involve the complexity of mixing with union. Part of that complexity is now being rushed after feature freeze. -- Marco Aurélio Deleu

« previous php.internals (#115562) next »