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!news.glorb.com!feeder.erje.net!eweka.nl!lightspeed.eweka.nl!195.114.241.69.MISMATCH!feeder.news-service.com!cyclone01.ams2.highwinds-media.com!news.highwinds-media.com!npeersf01.ams.highwinds-media.com!newsfe27.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: In-Reply-To: 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: newsfe27.ams2 1247310577 82.18.136.180 (Sat, 11 Jul 2009 11:09:37 UTC) NNTP-Posting-Date: Sat, 11 Jul 2009 11:09:37 UTC Organization: virginmedia.com Date: Sat, 11 Jul 2009 12:09:57 +0100 Xref: g2news2.google.com comp.lang.ada:6977 Date: 2009-07-11T12:09:57+01:00 List-Id: 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;?