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_20,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:ac8:5e49:0:b0:35b:b456:7261 with SMTP id i9-20020ac85e49000000b0035bb4567261mr17144040qtx.490.1664175273434; Sun, 25 Sep 2022 23:54:33 -0700 (PDT) X-Received: by 2002:a05:620a:1d02:b0:6ce:5820:2fdc with SMTP id dl2-20020a05620a1d0200b006ce58202fdcmr13328880qkb.638.1664175273282; Sun, 25 Sep 2022 23:54:33 -0700 (PDT) Path: eternal-september.org!reader01.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: Sun, 25 Sep 2022 23:54:33 -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: <7085edb5-688c-410c-b401-23ff3ca2a38fn@googlegroups.com> Subject: Compiler error (2) ? From: reinert Injection-Date: Mon, 26 Sep 2022 06:54:33 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:64405 List-Id: Hello, This must reveal a compiler error : ------------------------------------------------------------------------------------------------------- with Ada.Text_IO; with Ada.Containers.Vectors; procedure test1a is type s_name_type is (s0, s1, s2, s3, s4, s5, s6, s7, s8, s9); for s_name_type use (S0 => 0, S1 => 1, S2 => 2, S3 => 3, S4 => 4, S5 => 5, S6 => 6, S7 => 7, S8 => 8, S9 => 9); package s_names_p is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => s_name_type); k : integer := 7; -- n : constant integer := 7; -- uncomment this line and comment out the line below. n : constant integer := k; s_names: constant s_names_p.Vector := [for i in 3..n => S0]; begin Ada.Text_IO.Put_Line(s_names'Image); end test1a; ------------------------------------------------------------------------------------------------------- (compiled using alire and package Compiler is for Switches ("ada") use ("-gnatwa", "-gnata", "-gnatX", "-gnatwv"); end Compiler; ------------------------------------------------------------------------------------------------------- Right? reinert