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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,22ea9f82aa6070da,start X-Google-Attributes: gid103376,public From: "Mike Silva" Subject: Variant record question Date: 2000/01/21 Message-ID: <4V0i4.622$dw3.29725@news.wenet.net>#1/1 X-Deja-AN: 575803652 X-Mimeole: Produced By Microsoft MimeOLE V4.72.3110.3 X-Complaints-To: news@wenet.net X-Trace: news.wenet.net 948476608 206.169.137.33 (Fri, 21 Jan 2000 09:43:28 PST) NNTP-Posting-Date: Fri, 21 Jan 2000 09:43:28 PST Newsgroups: comp.lang.ada Date: 2000-01-21T00:00:00+00:00 List-Id: I've been working on some proof-of-concept code, and I don't understand something about arrays of variant records. Specifically, the following code works with a default discriminant defined for the type T_t, but if I remove the default discriminant it fails at the declaration of T_array_t. Why must I put in a default discriminant when I can then override it in an aggregate (variable 'A' below)? Thanks for any clarification. Mike package Test is type Dis_t is ( D1, D2 ); type T_t ( D : Dis_t := D1 ) is -- note default discriminant record case D is when D1 => I : Integer; when D2 => F : Float; end case; end record; type T_array_t is array (Integer range <>) of T_t; -- fails if no default Dis_t A : T_array_t := ( (D => D1, I => 99), (D => D2, F => 99.99) ); end Test;