From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_40,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a05:622a:4e:b0:3e9:7eee:f872 with SMTP id y14-20020a05622a004e00b003e97eeef872mr1947409qtw.9.1681488611382; Fri, 14 Apr 2023 09:10:11 -0700 (PDT) X-Received: by 2002:a25:d6d4:0:b0:b8e:ec30:853e with SMTP id n203-20020a25d6d4000000b00b8eec30853emr3335491ybg.4.1681488611135; Fri, 14 Apr 2023 09:10:11 -0700 (PDT) Path: eternal-september.org!news.eternal-september.org!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 14 Apr 2023 09:10:10 -0700 (PDT) Injection-Info: google-groups.googlegroups.com; posting-host=23.233.63.16; posting-account=4BrxqwoAAACaeBUgt-Wn9X00lDtb-a2P NNTP-Posting-Host: 23.233.63.16 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Rejected (legal?) program From: Nick Foubert Injection-Date: Fri, 14 Apr 2023 16:10:11 +0000 Content-Type: text/plain; charset="UTF-8" Xref: news.eternal-september.org comp.lang.ada:65097 List-Id: I raised this in the ada-lang gitter channel and it was suggested that this is likely a bug, but figured I'd post here before raising a bug report just in case. The following example program gives me a compile error with x86-64 gnat 12.2 (can also be seen at https://ada.godbolt.org/z/45G1x9sEd) example.adb:70:05: error: instantiation error at line 67 example.adb:70:05: error: "P_Formal_Type" is not a visible entity of "P_Instance" ----- procedure Example is generic type E_Formal_Type is abstract tagged private; package E is end; type E_Actual_Type is tagged null record; package E_Instance is new E (E_Actual_Type); generic with package E_Formal_Pkg is new E (<>); type D_Formal_Type is new E_Formal_Pkg.E_Formal_Type with private; package D is end; type D_Actual_Type is new E_Actual_Type with null record; package D_Instance is new D (E_Instance, D_Actual_Type); generic with package E_Formal_Pkg is new E (<>); with package D_Formal_Pkg is new D (E_Formal_Pkg => E_Formal_Pkg, others => <>); type P_Formal_Type is new E_Formal_Pkg.E_Formal_Type with private; package P is end; type P_Actual_Type is new E_Actual_Type with null record; package P_Instance is new P (E_Instance, D_Instance, P_Actual_Type); generic with package E_Formal_Pkg is new E (<>); with package D_Formal_Pkg is new D (E_Formal_Pkg => E_Formal_Pkg, others => <>); with package P_Formal_Pkg is new P (E_Formal_Pkg => E_Formal_Pkg, D_Formal_Pkg => D_Formal_Pkg, others => <>); package Test is type Test_Type is new P_Formal_Pkg.P_Formal_Type with null record; -- Line 67 end Test; package Test_Instance is -- Line 70 new Test (E_Instance, D_Instance, P_Instance); begin null; end Example; --- Per ARM 12.7.10/2 I believe that should be legal? A slight modification as can be seen at https://ada.godbolt.org/z/4x4h4s7f5 compiles successfully.