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: 103376,e89eefbf1ca016b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!z8g2000prd.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Discriminant & interface not implemented by full type Date: Wed, 11 Mar 2009 18:44:40 -0700 (PDT) Organization: http://groups.google.com Message-ID: <87ad6227-8c24-4788-9bb2-e2a5a2ee9048@z8g2000prd.googlegroups.com> References: NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1236822281 18776 127.0.0.1 (12 Mar 2009 01:44:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 12 Mar 2009 01:44:41 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z8g2000prd.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5024 Date: 2009-03-11T18:44:40-07:00 List-Id: On Mar 9, 10:21 am, Reto Buerki wrote: > Hi everyone, > > I have the following simple test application: > > package Full_View is > > type Base_Type (Num : Integer) is tagged private; > > type Base_Interface is interface; > > type New_Type is new Base_Type (Num => 11) and > Base_Interface with private; > > private > type Base_Type (Num : Integer) is tagged record > My_Number : Integer := Num; > end record; > > type New_Type is new Base_Type (Num => 11) and > Base_Interface with null record; > > end Full_View; > > Trying to compile this with gnat gcc 4.3 in Debian/Lenny results in the > following error: > full_view.ads:7:09: interface "Base_Interface" not implemented by full > type (RM-2005 7.3 (7.3/2)) > > When removing the (Num => 11) discrimant initialization or the > Base_Interface interface from the New_Type type extension, the code > compiles fine. > > Is this a compiler bug? Seems to me that the consistency check of the > partial and full view of a tagged type covering interfaces does not like > discriminants. > > Thanks for your help. Sure looks like a compiler bug to me. The program definitely doesn't violate the RM section paragraph that the error message refers to. -- Adam