Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126723 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 09E4F1A0136 for ; Tue, 11 Mar 2025 22:17:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741731277; bh=0wKxBACo+Vm/wr3Wn1E+6HolO0EsfvHyff8/c7j7uko=; h=Date:From:To:In-Reply-To:References:Subject:From; b=ADT7otyIaUXHco0B0PPPjxJq1uJb6ROTMJsK47ue27agjDxDxLpwBdgcneH3kLYSt uX6uA+2wI1gvTe6QtLsd7RVPr1Z3hZFfg4yc0mr8fXKS1rZmAx2gx+QyWgl7uBOHxx i2OywPQD3KYHRTNEkk5JhSbwvxTDDOhhAiNegm9QCSoTudZxrdJaQ5oz3c4urqWeKl +ZIpfDNq5bqOQV7OcZRggIZMGvUJZpRXA0ymozof2E9Z6DuoFQ0tMGjZevjT370/vG nj+VwlNGEvAwotZkBiPHONwylHtYGhH7AZfDkV7pppUpDB77s+sctfYNIj9K6/LRju 6if2s2FMksQEg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3D97618050B for ; Tue, 11 Mar 2025 22:14:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout-a7-smtp.messagingengine.com (fout-a7-smtp.messagingengine.com [103.168.172.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 11 Mar 2025 22:14:34 +0000 (UTC) Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.phl.internal (Postfix) with ESMTP id 1E1451382DDA for ; Tue, 11 Mar 2025 18:17:08 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-11.internal (MEProxy); Tue, 11 Mar 2025 18:17:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1741731428; x=1741817828; bh=FN+DZLVTdx 6qiskJlhBz3zuBrx3K63UHdnI+kq4EThs=; b=YS6WOpqjqwQBz4r1HkoZH58jXM NGWfkyvKZ8F7zn4WsIMo9vYIaWIZQMA1aWAsJM+4vm/mGc2M76Kc6XOAqil/lvGQ 1WJjGeXEbJ7mbqIL2wjgYuVQIbc+GwJ7B7tm/YbyDO3D9ccwgS+qm44m9jN0YE6J zzbCglh6HkFOApNp6iC9LuSRsXMVyt2yipVQSCWrz4o2sZUJ3L1KX0hQfwCNrHWD je4LSQTxQc6axL/L7TI4PGcIcukeOIpGcvZaTgvmMMh7HW4q3co8KZDvgiO4al2F 4QuVUdY6Uz/okGzacwx98DT2pxl5HuLzV5SwP5dfRRrPgRCzxRkgH8hanrdA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1741731428; x=1741817828; bh=FN+DZLVTdx6qiskJlhBz3zuBrx3K63UHdnI +kq4EThs=; b=VDr+hARPXlMN2MLw5+6ao/+TduXVGFoLua3nhhLQIJq9cvv3x8N e6Sp2fjDVhzdxLb4jGP4SuZpVCnFWbxSkdbQoJKQpXxMoJtjc2rBTpA7ALaSOpnY aeupd/3XUC1pZQ7PW6/agkLIWePfByKhzoFhrS24XjayLWLrfO1vcnZodAMQGxdu A/1qIcn2jJd6/FnsyISsBEXyFwkXV1brkZj0/yhDibbmZ0wVi6XMw2EOK9HGkIQO hKUHIP9M+/+jqSUCmPK+UY64lhiplKcBQwCVb9Hztqf1bNHvCDVVNDaQ0ah4eqKd Jfk5DtVIzPYPnvZvWA28PZzY1Ko9OYZvdJQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvdeffeejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefogg ffhffvkfgjfhfutgesrgdtreerredtjeenucfhrhhomhepfdftohgsucfnrghnuggvrhhs fdcuoehrohgssegsohhtthhlvggurdgtohguvghsqeenucggtffrrghtthgvrhhnpeehff duueetheeigfeuuedttdeukeevieekveffffegudevgfevffekjeffhfdtleenucffohhm rghinhepvgigthgvrhhnrghlshdrihhonecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheprhhosgessghothhtlhgvugdrtghouggvshdpnhgspghr tghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrg hlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id C2254780068; Tue, 11 Mar 2025 18:17:07 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Tue, 11 Mar 2025 23:16:47 +0100 To: internals@lists.php.net Message-ID: <99276fb0-548b-42b4-8ba1-5c96e3052640@app.fastmail.com> In-Reply-To: References: <934418CE-579E-4621-BB7A-5332B87C27B2@zort.net> Subject: Re: [PHP-DEV] [RFC] [Discussion] Never parameters Content-Type: multipart/alternative; boundary=d3d6ff414cd74e29b5b65585236e723b From: rob@bottled.codes ("Rob Landers") --d3d6ff414cd74e29b5b65585236e723b Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =20 >=20 >> I would also personally prefer associated types: ... This at least le= ts you ensure the "other point" is the same type in both functions, thou= gh personally, I'd rather just have generics. >=20 > I'd also like to have generics, but that isn't something I can impleme= nt myself. Associated types would be interesting, but I don't think that= associated types would remove the entire use-case for `never` parameter= s, just perhaps the specific example of BackedEnum. >=20 > ---- > - Daniel Heh, this is the long game I am playing with inner classes: https://exte= rnals.io/message/125049#125057 If inner classes can be implemented, then we are just a short hop from b= eing able to implement generics with a similar approach to what I outlin= ed in that thread. Granted, I'm making some major changes to the RFC at = the moment and the implementation -- based on feedback, so it'll be a fe= w days before that is finished. An inner class view of generics (as opposed to the type aliasing view in= that thread) looks something like this: // Box class Box { public class T {} // store(T $item) public function store(static:>T $item) {} } // new Box() $box =3D new class() extends Box { public class ItemType as T {} }; -Ish. Note that the example won=E2=80=99t actually work; but it illustra= tes how the engine could implement it if there were inner/nested types. So, assuming this new implementation I=E2=80=99ve been working on is waa= ay better than the old one (I think it is), and the RFC is accepted; we = may be closer to generics than you thought. Or maybe there is someone ou= t there with a whole different way of doing it that is even better=E2=80= =A6 This is the approach I'm chasing though. =E2=80=94 Rob --d3d6ff414cd74e29b5b65585236e723b Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable