Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Spock: The odds of surviving another attack are 13562190123 to 1, Captain.


devel / comp.lang.ada / Rejected (legal?) program

SubjectAuthor
o Rejected (legal?) programNick Foubert

1
Rejected (legal?) program

<fcc21c0e-4a1e-4d5d-954c-7dc20f045353n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9501&group=comp.lang.ada#9501

  copy link   Newsgroups: comp.lang.ada
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: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!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: <fcc21c0e-4a1e-4d5d-954c-7dc20f045353n@googlegroups.com>
Subject: Rejected (legal?) program
From: nick@metropolitan.ai (Nick Foubert)
Injection-Date: Fri, 14 Apr 2023 16:10:11 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 86
 by: Nick Foubert - Fri, 14 Apr 2023 16:10 UTC

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.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor