From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,FORGED_HOTMAIL_RCVD2, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,8581da5753cc1105,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.10.88 with SMTP id o24mr226766bko.0.1346254701757; Wed, 29 Aug 2012 08:38:21 -0700 (PDT) Received: by 10.224.223.77 with SMTP id ij13mr1423582qab.1.1346254701553; Wed, 29 Aug 2012 08:38:21 -0700 (PDT) Received: by 10.52.90.69 with SMTP id bu5mr272810vdb.6.1346254701518; Wed, 29 Aug 2012 08:38:21 -0700 (PDT) Path: m12ni146610bkm.0!nntp.google.com!news1.google.com!r1no25891226qas.0!news-out.google.com!da15ni59655611qab.0!nntp.google.com!r1no3220378qas.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 29 Aug 2012 08:38:21 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.122.158.4; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG NNTP-Posting-Host: 206.122.158.4 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <48024e68-4d18-4bbc-af47-102f32e4f43e@googlegroups.com> Subject: Mystery with "others" From: gautier_niouzes@hotmail.com Injection-Date: Wed, 29 Aug 2012 15:38:21 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-08-29T08:38:21-07:00 List-Id: Hello, I get an error message with the initialization of variable s4 below, that I don't understand. The workaround is easy, using the expression for variable s3. Still, I am curious about the reason. GNAT GPL 2012, with any of the modes Ada 95, 2005 and 2012, I get: test_sets.adb:10:21: "others" choice not allowed here ObjectAda 7.2.2 (Ada 95 only) is more verbose test_sets.adb: Error: line 10 col 17 LRM:4.3.3(11), An OTHERS is not allowed in this context because there is no applicable_index_constraint, Continuing So why is Ada unhappy with the expression after "s4 := " ? ---8<----8<----8<----8<-- procedure Test_sets is type Enum is (a,b,c,d); type Set is array(Enum) of Boolean; s1: Set := (a => True, others => False); s2: Set := (d => True, others => False); s3: Set := s1 or s2; s4: Set := s1 or (d => True, others => False); -- <- Line 10 begin null; end; ---8<----8<----8<----8<-- Gautier's Ada programming http://gautiersblog.blogspot.com/search/label/Ada NB: follow the above link for a valid e-mail address