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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Dispatch on the result still does not work? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1c6l5llyivd71.9dw3tmgglnlv.dlg@40tude.net> Date: Sat, 11 Jul 2009 21:22:03 +0200 Message-ID: <1wqdbionvt0ko$.1eyn16nbeb0pe$.dlg@40tude.net> NNTP-Posting-Date: 11 Jul 2009 21:21:57 CEST NNTP-Posting-Host: 9f57c2e9.newsspool1.arcor-online.net X-Trace: DXC=3_0HnBlDl^NI7\_^6>c20Jic==]BZ:afN4Fo<]lROoRA^YC2XCjHcbIXofUeHBj;mJDNcfSJ;bb[EIRnRBaCdl>j`V?l1dI X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:6997 Date: 2009-07-11T21:21:57+02:00 List-Id: On Sat, 11 Jul 2009 18:50:42 +0100, Chris Moore wrote: > Dmitry A. Kazakov wrote: >> On Sat, 11 Jul 2009 12:09:57 +0100, Chris Moore wrote: >> >>> Dmitry A. Kazakov wrote: >>>> Considering this one: >>>> >>>> package P is >>>> type T is tagged null record; >>>> function Value return T; >>>> >>>> type S is new T with null record; >>>> function Value return S; >>>> end P; >>>> >>>> package body P is >>>> function Value return T is >>>> begin >>>> return (null record); >>>> end Value; >>>> >>>> function Value return S is >>>> begin >>>> return (T with null record); >>>> end Value; >>>> end P; >>>> >>>> use P; >>>> >>>> X : T'Class := S'(Value); >>>> begin >>>> X := Value; -- Ambiguous? >>>> >>>> I would expect it rather dispatching on the tag of X, i.e. selecting Value, >>>> which returns S. >>>> >>> But X is of type T'Class. Or did you mean X := X.Value;? >> >> No. I meant function Value that has no arguments. > > Then both versions of Value are in scope and return types that can be > assigned to T'Class. Sounds ambiguous to me. It is, if you don't consider them dispatching, which was the question. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de