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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f298e2224380e530 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-13 05:13:00 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: gautier_niouzes@hotmail.com (Gautier) Newsgroups: comp.lang.ada Subject: Re: Disriminant question - Waiting desperately for solution :-( Date: 13 Mar 2003 05:13:00 -0800 Organization: http://groups.google.com/ Message-ID: <17cd177c.0303130513.46ee216a@posting.google.com> References: NNTP-Posting-Host: 213.173.163.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1047561180 25641 127.0.0.1 (13 Mar 2003 13:13:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 13 Mar 2003 13:13:00 GMT Xref: archiver1.google.com comp.lang.ada:35287 Date: 2003-03-13T13:13:00+00:00 List-Id: Grein, Christoph: > No, your analysis is quite wrong. L_Tern is defined without discriminant > in this example, so only its _default_ value is None, but it may change. > So the assignmant to L_Tern should work. Thank you (and sorry for the wrong information). I learnt again something about Ada. In that case L_Term can change discriminant when it wants - strange! ________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/gsoft.htm NB: For a direct answer, e-mail address on the Web site! ___ PS: I couldn't resist to test - maybe the OP should start with a simplified example and complicate it until the bug is picked... with Ada.Text_IO; use Ada.Text_IO; procedure Discri is type T_Leg_Type is (Df, Tf, Lif, Tp, Ppos, None); type T_Fix is new Integer; type T_Term (Leg_Type : T_Leg_Type := None) is record case Leg_Type is when Df | Tf | Lif | Tp => Fix : T_Fix; when Ppos | None => null; end case; end record; L_Term : T_Term; begin Put_Line( T_Leg_Type'image(L_Term.Leg_Type) ); L_Term := ( Leg_Type => Tf, Fix => 0); Put_Line( T_Leg_Type'image(L_Term.Leg_Type) ); L_Term := ( Leg_Type => Ppos ); Put_Line( T_Leg_Type'image(L_Term.Leg_Type) ); L_Term := ( Leg_Type => Df, Fix => 0); Put_Line( T_Leg_Type'image(L_Term.Leg_Type) ); Put_Line("Survived !"); end;