Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #35505
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Java 8 Lambda with generic types |
| Date | 2016-08-30 20:35 -0400 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <nq58nu$1qha$1@gioia.aioe.org> (permalink) |
| References | <df44fc1a-9d48-4ba8-890e-a687d24062a9@googlegroups.com> <335820fa-8b00-4bb3-8f0a-8f7c7463364c@googlegroups.com> |
On 8/28/2016 1:43 PM, Stone Zhong wrote:
> <quote>
> @SuppressWarnings("rawtypes")
> public static void checkToys(Toy ... toys) {
> </quote>
>
> It is not always possible or the best approach to use rawtypes,
> for example,
> say you have a interface called Duck
>
> public interface Duck {
> void squeak();
> }
>
> And you need
> public static void checkDuckToys(Toy<? extends Duck> ... toys) {
> for (Toy<? extends Duck> toy : toys) {
> for (Duck duck : toy.get()) {
> duck.squeak();
> }
> }
> }
True.
And I can not see any easy workarounds.
But I also think that the case is too rare to consider it a real
problem with Java 8 lambda type inference.
Arne
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Java 8 Lambda with generic types Stone Zhong <stone.zhong@gmail.com> - 2016-08-27 23:50 -0700
Re: Java 8 Lambda with generic types Stone Zhong <stone.zhong@gmail.com> - 2016-08-28 00:02 -0700
Re: Java 8 Lambda with generic types Arne Vajhøj <arne@vajhoej.dk> - 2016-08-28 07:46 -0400
Re: Java 8 Lambda with generic types Steven Simpson <ss@my.domain.invalid> - 2016-08-28 15:00 +0100
Re: Java 8 Lambda with generic types Lew <lewbloch@gmail.com> - 2016-08-30 22:25 -0700
Re: Java 8 Lambda with generic types Steven Simpson <ss@my.domain.invalid> - 2016-08-31 17:19 +0100
Re: Java 8 Lambda with generic types Steven Simpson <ss@my.domain.invalid> - 2016-08-28 08:19 +0100
Re: Java 8 Lambda with generic types Stone Zhong <stone.zhong@gmail.com> - 2016-08-28 03:26 -0700
Re: Java 8 Lambda with generic types Stone Zhong <stone.zhong@gmail.com> - 2016-08-28 07:45 -0700
Re: Java 8 Lambda with generic types Arne Vajhøj <arne@vajhoej.dk> - 2016-08-28 13:22 -0400
Re: Java 8 Lambda with generic types Stone Zhong <stone.zhong@gmail.com> - 2016-08-28 07:57 -0700
Re: Java 8 Lambda with generic types Stone Zhong <stone.zhong@gmail.com> - 2016-08-28 10:43 -0700
Re: Java 8 Lambda with generic types Arne Vajhøj <arne@vajhoej.dk> - 2016-08-30 20:35 -0400
Re: Java 8 Lambda with generic types Stone Zhong <stone.zhong@gmail.com> - 2016-09-02 15:18 -0700
csiph-web