From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,f857f366542cd8aa X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!goblin2!goblin.stu.neva.ru!cyclone01.ams2.highwinds-media.com!news.highwinds-media.com!npeersf01.ams.highwinds-media.com!newsfe13.ams2.POSTED!7564ea0f!not-for-mail From: Chris Moore User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Dispatch on the result still does not work? References: <4a58dfcf$0$30232$9b4e6d93@newsspool1.arcor-online.net> <1rfyxeircfmy1.19a1j3vqyttbo$.dlg@40tude.net> In-Reply-To: <1rfyxeircfmy1.19a1j3vqyttbo$.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <74j6m.69502$rO.69160@newsfe13.ams2> NNTP-Posting-Host: 82.18.136.180 X-Complaints-To: http://netreport.virginmedia.com X-Trace: newsfe13.ams2 1247395203 82.18.136.180 (Sun, 12 Jul 2009 10:40:03 UTC) NNTP-Posting-Date: Sun, 12 Jul 2009 10:40:03 UTC Organization: virginmedia.com Date: Sun, 12 Jul 2009 11:40:27 +0100 Xref: g2news2.google.com comp.lang.ada:7011 Date: 2009-07-12T11:40:27+01:00 List-Id: Dmitry A. Kazakov wrote: > On Sat, 11 Jul 2009 20:54:05 +0200, Georg Bauhaus wrote: > >> Dmitry A. Kazakov wrote: > >>> Considering this one: >>> I would expect it rather dispatching on the tag of X, i.e. selecting Value, >>> which returns S. >> Another one, I don't like to call this a solution, >> and the running program differs per compiler >> used. But both compilers compile the units without errors: > [...] > > I am not sure that it indeed should be resolved. The question is whether > there exist or should exist cases where one could indeed dispatch on the > result's type. The construct with assignment was admittedly artificial, it > was first that came to mind. > But the results type is T'Class. It is not S. The original object to which X refers is of type S. But this is destroyed prior to the assignment of the value returned by Value. This can be either S or T. With Georg's solution you now have three answers of the Ada way to resolve the ambiguity.