Re: [PHP-DEV] [RFC][Discuss] Covariant return- and contravariant parameter- types

2018-11-28 Thread Dan Ackroyd
Marcos Passos wrote: > Supporting `static` return would come in handy to define interfaces for > immutable objects. But it's not a requirement, right? With this RFC, the following code will work: class ParentImmutable { function modify() : ParentImmutable { ... } } class

Re: [PHP-DEV] [RFC][Discuss] Covariant return- and contravariant parameter- types

2018-11-27 Thread Larry Garfield
On Tuesday, November 27, 2018 3:00:27 PM CST Levi Morrison wrote: > On Tue, Nov 27, 2018 at 11:36 AM Larry Garfield wrote: > > Looks like fun! > > > > Would this also include allowing a return type of `static`, which would be > > useful for the "Return the object that was invoked" case or

Re: [PHP-DEV] [RFC][Discuss] Covariant return- and contravariant parameter- types

2018-11-27 Thread Levi Morrison
On Tue, Nov 27, 2018 at 2:00 PM Levi Morrison wrote: > > On Tue, Nov 27, 2018 at 11:36 AM Larry Garfield > wrote: > > > > On Monday, November 26, 2018 3:25:52 PM CST Levi Morrison wrote: > > > I am happy to announce my latest RFC, [Covariant Returns and > > > Contravariant Parameters][1], is

Re: [PHP-DEV] [RFC][Discuss] Covariant return- and contravariant parameter- types

2018-11-27 Thread Marcos Passos
Supporting `static` return would come in handy to define interfaces for immutable objects. Em ter, 27 de nov de 2018 às 19:01, Levi Morrison escreveu: > On Tue, Nov 27, 2018 at 11:36 AM Larry Garfield > wrote: > > > > On Monday, November 26, 2018 3:25:52 PM CST Levi Morrison wrote: > > > I am

Re: [PHP-DEV] [RFC][Discuss] Covariant return- and contravariant parameter- types

2018-11-27 Thread Levi Morrison
On Tue, Nov 27, 2018 at 11:36 AM Larry Garfield wrote: > > On Monday, November 26, 2018 3:25:52 PM CST Levi Morrison wrote: > > I am happy to announce my latest RFC, [Covariant Returns and > > Contravariant Parameters][1], is open for discussion. If you do not > > recognize those terms then

Re: [PHP-DEV] [RFC][Discuss] Covariant return- and contravariant parameter- types

2018-11-27 Thread Larry Garfield
On Monday, November 26, 2018 3:25:52 PM CST Levi Morrison wrote: > I am happy to announce my latest RFC, [Covariant Returns and > Contravariant Parameters][1], is open for discussion. If you do not > recognize those terms then hopefully the introduction coupled with the > [examples][2] will help.

Re: [PHP-DEV] [RFC][Discuss] Covariant return- and contravariant parameter- types

2018-11-27 Thread Benjamin Morel
I can only say that I've been waiting for this feature for years and am really looking forward to see it implemented, hopefully in 7.4. Good job on the RFC, I wish you luck! On Mon, 26 Nov 2018 at 22:26, Levi Morrison wrote: > I am happy to announce my latest RFC, [Covariant Returns and >

Re: [PHP-DEV] [RFC][Discuss] Covariant return- and contravariant parameter- types

2018-11-27 Thread Michał Brzuchalski
Can't wait for it to happen! Thank you for your work and fixing object type. pon., 26 lis 2018 o 22:26 Levi Morrison napisał(a): > I am happy to announce my latest RFC, [Covariant Returns and > Contravariant Parameters][1], is open for discussion. If you do not > recognize those terms then

Re: [PHP-DEV] [RFC][Discuss] Covariant return- and contravariant parameter- types

2018-11-26 Thread Marcos Passos
I'm waiting for it for a long time! Thank you for putting effort on this! Em seg, 26 de nov de 2018 às 19:26, Levi Morrison escreveu: > I am happy to announce my latest RFC, [Covariant Returns and > Contravariant Parameters][1], is open for discussion. If you do not > recognize those terms then

[PHP-DEV] [RFC][Discuss] Covariant return- and contravariant parameter- types

2018-11-26 Thread Levi Morrison
I am happy to announce my latest RFC, [Covariant Returns and Contravariant Parameters][1], is open for discussion. If you do not recognize those terms then hopefully the introduction coupled with the [examples][2] will help. Here is one snippet that demonstrates covariant return types: