Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114496 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 88769 invoked from network); 17 May 2021 14:08:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 May 2021 14:08:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 82ECC1804F4 for ; Mon, 17 May 2021 07:17:36 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 17 May 2021 07:17:35 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 496B65C00C1 for ; Mon, 17 May 2021 10:17:35 -0400 (EDT) Received: from imap8 ([10.202.2.58]) by compute4.internal (MEProxy); Mon, 17 May 2021 10:17:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Ykb54R igMKTtV3h3jM1COtga8ocPyDXO5w452N5MPLM=; b=sHWMZqpYbTpVekjuD6aRdk 7F95aleAgpN2PMAGkCeTbZOhBA5DnwVy9uake01DuACNQdQAnT2F4ln0EOejo+G7 d3e8zEnc+3I/zslvSAfKRUUNzPqvMWsWYs3XmIGq98jjrgdPaclBdDGwRMDdKeyI Z19pV+dj/O6AA+XkuOA/VbwOcFQpcPtokBNy22wxNTHbHWsVhIesjbmfd262Bs6O 2VNADwXKl8nx6mqCE20Vk+W3cAGrw0wnIX9qgrom7lnWErjTQ5RSde2JdGli3A9h JJXQlhL77j4d1sphXBY3krlbO/Rw7d8h53YaypkzpOqfceFbIE/zmEOcD2upQWlQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdeihedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeevheehvdevjeelvdevgfelvefftdejkeelvdekgeeh fffgiedvjefhhfeltdduteenucffohhmrghinhepphhhphdrnhgvthenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhi vghlughtvggthhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id EA79F3A0130; Mon, 17 May 2021 10:17:34 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-448-gae190416c7-fm-20210505.004-gae190416 Mime-Version: 1.0 Message-ID: <624d7ea6-f9e3-4f0a-baea-9da15a75fdb0@www.fastmail.com> In-Reply-To: References: Date: Mon, 17 May 2021 09:17:13 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] Pure intersection types From: larry@garfieldtech.com ("Larry Garfield") On Mon, May 17, 2021, at 3:58 AM, G. P. B. wrote: > Hello internals, > > As we are getting closer to feature freeze I want to move this proposal > forward. > The RFC is now also on the wiki: > https://wiki.php.net/rfc/pure-intersection-types > > Composite types are left out of scope as it seems they should be handled > with grouping (e.g. (A&B) | C ) and not relying on the precedence of the > union operator. > > It should also be noted that to get this working there is some parser > hackery done to circumvent the fact the it cannot resolve the ambiguity > between & for an intersection type and & for by-ref arguments. I am very much a fan. On the reflection front, am I correct that we'd end up with: abstract ReflectionType -- ReflectionNamedType (single type) -- ReflectionUnionType (basically an array of named types) -- ReflectionIntersectionType (basically an array of named types) Where ReflectionUnionType and ReflectionIntersectionType are basically the same API to decompose further. And should combined intersection/union types be added in the future, the impact would be that their getTypes() methods would return an array of some combination of ReflectionTypes, whereas right now you could rely on them being ReflectioNamedType. (But that also means one could build ahead for that already with a little recursion.) Am I following that correctly? --Larry Garfield