comp.lang.ada
 help / color / mirror / Atom feed
* defaults on discriminants
@ 1994-11-15 22:54 Gene McCulley
  1994-11-20 17:14 ` Robert Dewar
  0 siblings, 1 reply; 2+ messages in thread
From: Gene McCulley @ 1994-11-15 22:54 UTC (permalink / raw)


The following compiles fine under LegacyAda 1.4.0 and GNAT but does not under
Rational Apex 1.4.1 on the RS/6000:

procedure Dummytest is

    type Integer_Array is array (Natural range <>) of Integer;

    type Foo_Record_Type (Count1 : Natural := 1) is
        record
            Things : Integer_Array (1 .. Count1);
    end record;

    My_Foo : Foo_Record_Type (5);
begin
    My_Foo.Things (1) := 5;
end Dummytest;

!!! [MID] Program will raise CONSTRAINT_ERROR (Range_Error) at "type
FOO_RECORD_TYPE (COUNT1 : NATURAL := 1) is " (DUMMYTEST'BODY.2D)

The Apex generated executable says:
Exception CONSTRAINT_ERROR (Range_Error) raised
and then shows the type definition for Foo_Record_Type in the debugger.

Apex compiles this fine if I give no default for the discriminant.
Shouldn't I be able to give it a default?



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1994-11-20 17:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1994-11-15 22:54 defaults on discriminants Gene McCulley
1994-11-20 17:14 ` Robert Dewar

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