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!news2.google.com!npeer01.iad.highwinds-media.com!feed-me.highwinds-media.com!cyclone01.ams2.highwinds-media.com!news.highwinds-media.com!npeersf01.ams.highwinds-media.com!newsfe12.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: <1c6l5llyivd71.9dw3tmgglnlv.dlg@40tude.net> In-Reply-To: <1c6l5llyivd71.9dw3tmgglnlv.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 82.18.136.180 X-Complaints-To: http://netreport.virginmedia.com X-Trace: newsfe12.ams2 1247334621 82.18.136.180 (Sat, 11 Jul 2009 17:50:21 UTC) NNTP-Posting-Date: Sat, 11 Jul 2009 17:50:21 UTC Organization: virginmedia.com Date: Sat, 11 Jul 2009 18:50:42 +0100 Xref: g2news2.google.com comp.lang.ada:6992 Date: 2009-07-11T18:50:42+01:00 List-Id: 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. X := S'(Value);?