Re: Parameter type widening RFC
| From: | Christoph M. Becker | Date: | Sun, 28 May 2017 13:16:22 +0000 |
| Subject: | Re: Parameter type widening RFC | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99213@lists.php.net to get a copy of this message | ||
On 28.05.2017 at 12:30, Rasmus Schultz wrote:
> In my opinion, this will very likely lead to a large number of accidental
> type-hint omissions - and a very, very small number of actually useful
> solutions to real problems.
>
> In my opinion, we can do much better than that, by adding a mixed
> type-hint, which will ensure people aren't just accidentally omitting
> type-hints and instead explicitly opting out of it to achieve parameter
> widening. Solving this from the start also ensures we can have a clean
> implementation of real contravariance in the future, without that being a
> break change.
Something like that has already been suggested in the original RFC
discussion[1] but has been rejected, so I don't think it makes much
sense to repeat this discussion again.
[1] <http://news.php.net/php.internals/97106>
--
Christoph M. Becker