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,2ff5c149712ec0eb X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!fdn.fr!club-internet.fr!feedme-small.clubint.net!newsfeed.freenet.de!feeder.news-service.com!feeder3.cambrium.nl!feed.tweaknews.nl!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Ada Interfaces and the Liskov Substitution Principle References: Date: Wed, 23 May 2007 22:32:49 +0200 Message-ID: <871wh7i8lq.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:a44fcjlDPlp5Os0IJF3938/j0SI= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tele2 X-Trace: DXC=_cFQnmVSI5GP@0DabYlS7F6`Y6aWje^YJldDd_]VW__EZP]2?ngYW5ECQ8?Q<1lG6J`A:YQHf056G Xref: g2news1.google.com comp.lang.ada:15892 Date: 2007-05-23T22:32:49+02:00 List-Id: Stefan Lucks writes: > package Parents is > type Parent is Interface; > > -- primitive operation > procedure Do_Something(Self: in out Parent) is abstract; > > -- class-wide operations > procedure Do_Nothing(From: in Parent'Class; > To: out Parent'Class); > procedure Convert(From: in Parent'Class; > To: out Parent'Class); > end Parents; > with Parents, Ada.Finalization; > > package Stepchild is > > type Object is > new Ada.Finalization.Limited_Controlled > and Parents.Parent > with private; > > procedure Do_Something (Self: in out Object); > > private > > ... doesn't really matter ... > > end Stepchild; > What do you guys think about this? I think the declaration of Stepchild.Object is illegal because ARM 3.9.4(12/2) states: "A type derived from a nonlimited interface shall be nonlimited." Since GNAT is currently the only compiler with Ada 2007 features, I presume it must be a bug in GNAT. What version are you using? -- Ludovic Brenta.