comp.lang.ada
 help / color / mirror / Atom feed
From: Mark.Doherty@uk.thalesgroup.com (Mark Doherty)
Subject: Discriminated record question
Date: 7 May 2002 05:17:46 -0700
Date: 2002-05-07T12:17:46+00:00	[thread overview]
Message-ID: <2d87db3f.0205070417.7a50667b@posting.google.com> (raw)

Why does the following raise a constraint error on the declaration of
'B'.

I would not expect the declarations of 'A' or 'B' to raise a
constraint error.

If the compiler is right what, is the subtle difference between them
that allows 'A' not to raise the constraint error.

I am using Rational 3.2 compiler (PowerPC and Sun Solaris)



procedure Test is
    type A_Type (Text_Size : Natural := 0) is
       record
            Text : String (1 .. 0);
        end record;
    A : A_Type;

    type B_Type (Text_Size : Natural := 0) is
        record
            Text : String (1 .. Text_Size);
        end record;

    B : B_Type;  

begin
    null;
end Test;



             reply	other threads:[~2002-05-07 12:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-07 12:17 Mark Doherty [this message]
2002-05-10  9:27 ` Discriminated record question Emmanuel Briot
  -- strict thread matches above, loose matches on Subject: below --
2002-05-07 12:45 Grein, Christoph
2002-05-07 19:18 ` Randy Brukardt
2002-05-09  2:52   ` Robert Dewar
2002-05-09 20:29     ` Randy Brukardt
2002-05-08 10:10 ` Mark Doherty
2002-05-09  2:56   ` Robert Dewar
2002-05-15 15:34     ` Mark Doherty
2002-05-15 18:12       ` Jeffrey Carter
2002-05-16  5:03 Grein, Christoph
replies disabled

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