comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: error: choice must be static?
Date: Tue, 13 Feb 2024 11:45:17 +0000	[thread overview]
Message-ID: <lybk8klh9u.fsf@pushface.org> (raw)
In-Reply-To: uqej3l$1prfv$1@dont-email.me

"Randy Brukardt" <randy@rrsoftware.com> writes:

> Looks like a compiler bug to me. The nonsense message gives that away... :-)

GCC 14.0.1 says

     1. procedure test_20240211_static_choice is
     2.
     3.    package Maps is
     4.       type Map_Type is private
     5.         with Aggregate =>  (Empty     => Empty_Map,
                     |
        >>> error: aspect "Aggregate" can only be applied to non-array type

     6.                             Add_Named => Add_To_Map);
     7.       procedure Add_To_Map (M : in out Map_Type; Key : in Integer;
     8.       Value : in String);
     9.       Empty_Map : constant Map_Type;
    10.    private
    11.       type Map_Type is array (1..10) of String (1..10);
    12.       procedure Add_To_Map (M : in out Map_Type; Key : in Integer;
    13.       Value : in String) is null;
    14.       Empty_Map : constant Map_Type := [1..10 => "          "];
                                                 |
        >>> error: choice must be static

    15.    end;
    16.
    17. begin
    18.    null;
    19. end;

I think the first is because of ARM 4.3.5(2), "For a type other than an
array type, the following type-related operational aspect may be
specified"[1] and the second is a "nonsense" consequence.

[1] http://www.ada-auth.org/standards/22rm/html/RM-4-3-5.html#p2

  reply	other threads:[~2024-02-13 11:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-11 12:29 error: choice must be static? Blady
2024-02-11 20:56 ` Jeffrey R.Carter
2024-02-12  8:12   ` Dmitry A. Kazakov
2024-02-13  2:12 ` Randy Brukardt
2024-02-13 11:45   ` Simon Wright [this message]
2024-02-14  4:28     ` Randy Brukardt
2024-02-17  8:51       ` Blady
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox