<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 10, 2016, at 1:34 PM, Howard Lovatt <<a href="mailto:howard.lovatt@gmail.com" class="">howard.lovatt@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">@Thorsten,<div class=""><br class=""></div><div class="">No it doesn't, the following Java code:</div><div class=""><br class=""></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class=""><div class="">public class GenericReturnTypes {</div></div><div class=""><div class=""> interface Foo {</div></div><div class=""><div class=""> static <Output extends Number> Output foo() {</div></div><div class=""><div class=""> return (Output)(new Integer(0));</div></div><div class=""><div class=""> }</div></div><div class=""><div class=""> }</div></div><div class=""><div class=""> public static void main(String[] args) {</div></div><div class=""><div class=""> System.out.println(Foo.foo());</div></div><div class=""><div class=""> }</div></div><div class=""><div class="">}</div></div></blockquote><div class=""> </div><div class="">Compiles without error or warning, runs, and prints 0.</div></div></div></blockquote><br class=""></div><div>This works by inferring Output == Number. This also unsafely allows 'Float foo = Foo.foo();', which would fail the cast.</div><div><br class=""></div><div>-Joe</div><br class=""></body></html>