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,4894bc8fcf637af8 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Interfaces and private types Date: Mon, 28 Jan 2008 16:58:25 -0600 Organization: Jacob's private Usenet server Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1201561116 2330 69.95.181.76 (28 Jan 2008 22:58:36 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 28 Jan 2008 22:58:36 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 Xref: g2news1.google.com comp.lang.ada:19640 Date: 2008-01-28T16:58:25-06:00 List-Id: "Philippe Tarroux" wrote in message news:fnl2in$k49$1@news2.u-psud.fr... > Hi again, > > There is no compilation problem with the following code : > > package Test_Interfaces is > > type Int is synchronized interface; > procedure Init (I : in out Int) is abstract; > > type T is new Int with private; > > private > > task type T is > entry Init; > end T; > end Test_Interfaces; As written, this is illegal because type T does not have the interface Int. Specifically, it violates 7.3(7.3/2): "the partial view shall be a descendant of an interface type (see 3.9.4) if and only if the full type is a descendant of the interface type." Assuming that this is just a mistake in your interface and you meant task type T is new Int with then your program is legal, and you should complain your your compiler vendor about the bug. In no case should there be an error on the declaration of the object, so that makes it pretty clear that there is a compiler bug. You could work around the bug with something like: package Test_Interfaces is type Int is synchronized interface; procedure Init (I : in out Int) is abstract; type T is new Int with private; overriding procedure Init (I : in out T); private task type T is new Int with entry Init; end T; end Test_Interfaces; and then have procedure Init (I : in out T) is begin I.Init; end Init; in the body. (But note that this runs into a known bug in the Ada standard, so it isn't clear that the code will work right.) Randy.