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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7f472b5a22d27612,start X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Generic Formal With Discrim Used As Actual - How? Date: 1998/10/25 Message-ID: #1/1 X-Deja-AN: 404811335 Sender: matt@mheaney.ni.net NNTP-Posting-Date: Sun, 25 Oct 1998 01:14:01 PDT Newsgroups: comp.lang.ada Date: 1998-10-25T00:00:00+00:00 List-Id: I'm having trouble passing generic formal types --one of which has an access discriminant-- as generic actuals to another generic having an identical profile. Something like: generic type T1 (<>) is limited private; type T2 (O : access T1) is limited private; procedure GP; generic type T1 (<>) is limited private; type T2 (O : access T1) is limited private; procedure GQ; with GQ; procedure GP is procedure Q is new GQ (T1, T2); begin null; end GP; When I try to compile the body of GP, I get the following message: (start of compiler message) gnatf /home/matt/acl/rings/gp.adb gp.adb:4:30: types of actual discriminants must match formal gp.adb:4:30: instantiation abandoned Compilation exited abnormally with code 1 at Sun Oct 25 01:13:09 (end of compiler message) Can someone explain what's going on here? Why doesn't this code compile? Is there any way to pass a formal type with a discriminant as the actual type of another instantiation? Thanks, Matt