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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:ac8:758a:: with SMTP id s10mr14316316qtq.283.1581419707671; Tue, 11 Feb 2020 03:15:07 -0800 (PST) X-Received: by 2002:a05:6808:4c7:: with SMTP id a7mr2529417oie.83.1581419707406; Tue, 11 Feb 2020 03:15:07 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 11 Feb 2020 03:15:07 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=173.225.51.130; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy NNTP-Posting-Host: 173.225.51.130 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <7b1e3204-6a95-4d33-a967-a458566208f2@googlegroups.com> Subject: Generic Parent Specification From: sbelmont700@gmail.com Injection-Date: Tue, 11 Feb 2020 11:15:07 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:58028 Date: 2020-02-11T03:15:07-08:00 List-Id: Is there any incantation for generics that allows you to specify that one a= ctual generic package must be a child of another? Suppose a generic packag= e along with a child, and then a third generic that withs in them both, e.g= : generic package X is type T1 is new Integer; end X; generic package X.Y is subtype T2 is T1; end X.Y; generic with package K1 is new X (<>); with package K2 is new X.Y (<>); package P is o1 : K2.T2 :=3D 0; o2 : K1.T1 :=3D o1; -- error! end P; The error seems sensible enough, since the actual for K1 might not actually= be a "real" parent of the actual for K2, and the types might indeed be inc= ompatible. But in cases where K2 is a legit child of K1, the conversion ou= ght to be fine. Conceptually I want something like this: generic with package K1 is new X (<>); with package K2 is new K1.Y (<>); -- K2 must be a instantiation of X.Y f= rom K1 but either I can't find the right spell to do this, or it's not possible. = Any ideas? -sb