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=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:ac8:5889:0:b0:344:57e5:dc54 with SMTP id t9-20020ac85889000000b0034457e5dc54mr19064951qta.465.1662881240359; Sun, 11 Sep 2022 00:27:20 -0700 (PDT) X-Received: by 2002:a05:6214:d65:b0:4ac:7dc2:b15b with SMTP id 5-20020a0562140d6500b004ac7dc2b15bmr12801591qvs.130.1662881240240; Sun, 11 Sep 2022 00:27:20 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 11 Sep 2022 00:27:20 -0700 (PDT) Injection-Info: google-groups.googlegroups.com; posting-host=84.209.88.37; posting-account=bPTmZAoAAAC_6HP9XLKB9aAAxBa6BuOR NNTP-Posting-Host: 84.209.88.37 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Is this an error in compiler? From: reinert Injection-Date: Sun, 11 Sep 2022 07:27:20 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2897 Xref: reader01.eternal-september.org comp.lang.ada:64313 List-Id: Hello, I tried alire with the latest version of the compiler (I believe) and I got trouble compiling this program (which I here have reduced just to communicate my point - i.e. the program has no other meaning here): -------------------------------------------------------------------------------------------- with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Exceptions; with Ada.Text_IO; use Ada.Text_IO; procedure c0a is subtype String_1 is String (1 .. <>); package cpros is cfe0,cfe1,cfe2 : exception; generic with procedure execute_command1 (command1 : String); procedure cpros0 (file1 : in Ada.Text_IO.File_Type; command0 : String := ""); end cpros; package body cpros is procedure cpros0 (file1 : in Ada.Text_IO.File_Type; command0 : String := "") is begin declare function rep1 (str0 : String_1) return String is i : constant Natural := Index (str0, "$"); begin return str0 when i = 0; -- raise cfe2 with "(wrong use of '$')" when i = str0'Last; -- a if i = str0'Last then -- b raise cfe2 with "(wrong use of '$')"; -- b end if; -- b return "aaa"; end rep1; str0 : constant String := rep1 (Get_Line (file1)); begin null; end; end cpros0; end cpros; procedure execute_command1 (str : String) is begin null; end execute_command1; procedure cpros1 is new cpros.cpros0 (execute_command1 => execute_command1); begin null; end c0a; ----------------------------------------------------------------------------------------------- This goes through when I compile it. However, if I uncomment the "a" line and comment out the alternative "b" line (see code above), then I get the error message: c0a.adb:45:04: error: instantiation error at line 27 c0a.adb:45:04: error: "cfe2" is not visible c0a.adb:45:04: error: instantiation error at line 27 c0a.adb:45:04: error: non-visible declaration at line 10 Have you the same experience? reinert