Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Mike Amling Newsgroups: comp.lang.java.programmer Subject: Re: can this be done with generics? Date: Wed, 27 Nov 2013 11:05:38 -0600 Lines: 21 Message-ID: References: <52955b12$0$299$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net gH6SxloLIE6RrDhKzAoLZgfspDeWwPVhrOvRHTBXWd0giBMQKs Cancel-Lock: sha1:TwYZJ94NCyIkW5+uoegZIo7iWPo= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 In-Reply-To: <52955b12$0$299$14726298@news.sunsite.dk> Xref: csiph.com comp.lang.java.programmer:26640 On 11/26/13 8:38 PM, Arne Vajhøj wrote: > On 11/25/2013 10:02 AM, Mike Amling wrote: >> >> I don't think the compiler has all the information needed to guarantee >> that new Bar().foo1().bar() will be executable at runtime. The compiler >> may know, from the "return this" in foo1 that it's safe if you run with >> the Foo.class and the Bar.class files that it is now generating. But the >> compiler also should know that the Bar.class file it's writing may be >> run with a Foo.class file from a later compile of a Foo.java that's been >> changed > > Incompatible changes to a dependency class later does not bother > many other language constructs. Yes, in particular I've noticed the hijinks that the switch (enum instance) bytecode goes through to get runtime compatibility with a separately modified and recompiled enum class. Mike Amling -- If agua is good, then two guas must be better.