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,93da5260093a8774 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!s28g2000vbp.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Bug with variant derived from interface? Date: Wed, 3 Jun 2009 15:12:56 -0700 (PDT) Organization: http://groups.google.com Message-ID: <8087ca47-e546-47ae-8cf0-13099dbe7375@s28g2000vbp.googlegroups.com> References: <78np2hF1ndha3U1@mid.individual.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1244067176 13870 127.0.0.1 (3 Jun 2009 22:12:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 3 Jun 2009 22:12:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s28g2000vbp.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6197 Date: 2009-06-03T15:12:56-07:00 List-Id: On Jun 3, 10:09=A0am, "Alex R. Mosteo" wrote: > Before reporting a bug to Adacore I'd like to have your opinion. With the > following test program I get the error below in both GPL2008/2009. > > procedure Bugcase is > > =A0 =A0-- =A0type Base is abstract tagged null record; > =A0 =A0-- =A0This works > > =A0 =A0type Base is interface; > =A0 =A0-- =A0This does not work. > > =A0 =A0type Derived_Ok (X : Boolean) is new Base with null record; > > =A0 =A0type Derived_Also_Ok (X : Boolean) is new Base with record > =A0 =A0 =A0 Y : Integer; > =A0 =A0end record; > > =A0 =A0type Derived_Bad (X : Boolean) is new Base with record > =A0 =A0 =A0 -- =A0Above line is the one failing. > =A0 =A0 =A0 case X is > =A0 =A0 =A0 =A0 =A0when others =3D> null; > =A0 =A0 =A0 end case; > =A0 =A0end record; > > begin > =A0 =A0null; > end Bugcase; > > $ gnatmake bugcase.adb > gcc -c bugcase.adb > bugcase.adb:14:09: call to abstract function must be dispatching > gnatmake: "bugcase.adb" compilation error I don't see any reason this program should be illegal. The message involving a "call to abstract function" is certainly wrong, because there aren't any abstract function calls involved. (Just as a wild guess, I'm guessing that the abstract function GNAT is complaining about is "=3D", and there's some special subroutine that tries to compose the equality function for variant records that isn't handling this case right... did I come close???) -- Adam