AW: [PHP-DEV] [RFC:generics]
| From: | Robert Stoll | Date: | Sat, 30 Apr 2016 10:51:36 +0000 |
| Subject: | AW: [PHP-DEV] [RFC:generics] | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-92978@lists.php.net to get a copy of this message | ||
> > In this case I would suggest to use class A<T <: T1> which leaves room
> > open to define lower bounds later on
>
> IMHO that is bordering on unreadable - all those brackets are really confusing and hard on the
> eyes.
>
I agree, it looks quite ugly :-)
Therefore another suggestion:
class A<T1, T2> [Foo <: T1, T2 <: Bar] {
//....
}
> Either way, using : does not prevent us from adding lower bounds later on - but even then,
> upper bound is the 99% use
> case, so I don't think it makes sense to design the syntax around a possible future upper
> bound.
>
> If we do support it in the future, I don't think anyone's going to care what it looks
> like, as it's unlikely most people will ever
> encounter it or need it.
>
You're probably right. I use wildcard types with lower bounds in Java from time to time but
rather rarely.