Hi,

Thanks for the pointer! This related example in this blog post says it all:

"[...] So why does it seem like Foo<String> should be invalid? How is it bar 
safe? Well, the answer to both is the same: Foo<String> is uninstantiable. 
You’ll never be able to create an instance of Foo<String> because String is not 
a subtype of Number. Thus the seemingly unsafe invocation of foo in bar will 
never happen because you can’t invoke a method of an object that can never 
exist."

Took a while, but now I understand it :-)

Uwe

-----
Uwe Schindler
Achterdiek 19, D-28357 Bremen
http://www.thetaphi.de
eMail: [email protected]

> -----Original Message-----
> From: Dawid Weiss [mailto:[email protected]]
> Sent: Thursday, January 26, 2017 10:15 AM
> To: [email protected]
> Cc: Uwe Schindler (SD DataSolutions GmbH) <[email protected]>
> Subject: Something for Generics Policeman
> 
> Hi Uwe!
> 
> I thought I'd share something that will send you down the spiral of
> looped insanity: a bug in the type Java's generic type system. Enjoy
> the read!
> 
> https://hackernoon.com/java-is-unsound-28c84cb2b3f
> 
> Dawid
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to