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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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!postnews.google.com!x35g2000prf.googlegroups.com!not-for-mail From: Anh Vo Newsgroups: comp.lang.ada Subject: Re: Ada Interfaces and the Liskov Substitution Principle Date: 23 May 2007 17:56:44 -0700 Organization: http://groups.google.com Message-ID: <1179968204.227974.265810@x35g2000prf.googlegroups.com> References: <871wh7i8lq.fsf@ludovic-brenta.org> NNTP-Posting-Host: 209.225.225.89 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1179968228 13766 127.0.0.1 (24 May 2007 00:57:08 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 24 May 2007 00:57:08 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322; InfoPath.1),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: x35g2000prf.googlegroups.com; posting-host=209.225.225.89; posting-account=JVr7Xg0AAAAI3MbuARxMmvWLmA7qdJMx Xref: g2news1.google.com comp.lang.ada:15896 Date: 2007-05-23T17:56:44-07:00 List-Id: On May 23, 3:00 pm, "Randy Brukardt" wrote: > "Ludovic Brenta" wrote in message > > news:871wh7i8lq.fsf@ludovic-brenta.org... > > > Stefan Lucks writes: > ... > > > 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." > > Right. The most general type of interface is a limited interface; every > interface should be declared limited if possible. (We didn't make that the > default solely because it would be inconsistent with the rest of the > language.) And if it is not possible to declare the interface limited (as in > the example), then all types that include it must be nonlimited. At least > interfaces don't have the rather limiting rule that regular tagged types do, > where the limitedness can't be changed at all. Indeed, GNAT-GPL-2007 complains that "stepchild.ads:12:04: progenitor interface "Parent" of limited type must be limited". In addition, if the Object is changed Controlled type instead, there is no problem with compilation. AV