Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: can this be done with generics? Date: Tue, 26 Nov 2013 08:16:43 +0100 Lines: 22 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net u+lrcw+0ALrKKKI9Wr8g8A2qnhZpnAtjGDsLNE7vmmRRorIyU= Cancel-Lock: sha1:0F9atr2VWqhPTvgBOdb9QnCru6A= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 In-Reply-To: X-Antivirus: avast! (VPS 131125-1, 25.11.2013), Outbound message X-Antivirus-Status: Clean Xref: csiph.com comp.lang.java.programmer:26619 On 26.11.2013 02:04, Andreas Leitgeb wrote: > I hoped, one could spice up method foo() with some specific > generic wizardry, such that the compiler would see a return > type, that (almost) nothing else than "this" could satisfy. > > That would prevent even overrides of foo() returning anything else > than their "this" pointer. Alas, there doesn't seem to exist this > kind of wizardry in today's Java. Why don't you think that my solution [1] qualifies? Kind regards robert [1] Message-ID: -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/