comp.lang.ada
 help / color / mirror / Atom feed
From: "Grein, Christoph" <christoph.grein@eurocopter.com>
To: comp.lang.ada@ada.eu.org
Subject: Re: Disriminant question - Waiting desperately for solution :-(
Date: Thu, 13 Mar 2003 06:40:35 +0100 (MET)
Date: 2003-03-13T06:40:35+01:00	[thread overview]
Message-ID: <mailman.17.1047534648.308.comp.lang.ada@ada.eu.org> (raw)

From: gautier_niouzes@hotmail.com (Gautier)
> 
> 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 : SERVER_TYPES.T_TERM;
> 
> Well, L_TERM has the discriminant LEG_TYPE = NONE.
> Then L_TERM.FIX is a nonsense. This is why...
> 
>       L_TERM := (LEG_TYPE => SERVER_TYPES.TF, 
>                  FIX =>
> 
> ...bombs with a "discriminant error". Fun, isn't it ?

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.

The code snippet is too coarse to come to a conclusion why this error occurs (at 
least I didn't feel like chasing the error in this mess :-).



             reply	other threads:[~2003-03-13  5:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-13  5:40 Grein, Christoph [this message]
2003-03-13 13:13 ` Disriminant question - Waiting desperately for solution :-( Gautier
  -- strict thread matches above, loose matches on Subject: below --
2003-03-07  7:09 Disriminant question prashna
2003-03-07 11:17 ` Lutz Donnerhacke
2003-03-07 16:46   ` Matthew Heaney
2003-03-12  9:25     ` Disriminant question - Waiting desperately for solution :-( prashna
2003-03-12 16:12       ` Gautier
replies disabled

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