From: "Christoph Karl Walter Grein" <AdaMagica@web.de>
To: comp.lang.ada@ada-france.org
Subject: Re: String Pointer Bug
Date: Mon, 08 Nov 2004 14:34:10 +0100
Date: 2004-11-08T14:34:10+01:00 [thread overview]
Message-ID: <mailman.83.1099920902.10401.comp.lang.ada@ada-france.org> (raw)
A long time ago, I made an exegesis of this problem. You may find it below
(sorry if the indentation should be lost, it's my mailer that swallows it, I do not know
to avoid this):
procedure Try is
type D is array (Integer range <>) of Boolean;
type A is access all D;
X: aliased D (1..3);
AX: A := X'Access; -- not OK
BX: A (X'Range) := X'Access; -- not OK
Y: aliased D := X;
AY: A := Y'Access; -- OK
BY: A (Y'Range) := Y'Access; -- OK
begin
null;
end Try;
----------------------------------------------------
-- My exegesis:
--
-- RM 3.3.1(8,9)
--
-- Nominal Actual
-- subtype
-- X D (1..3) D (1..3)
-- Y D D (1..3)
--
-- So the actual subtypes are constrained.
-- X is a constrained object because its nominal subtype is constrained
-- and Y is an object constrained by its initial value.
--
-- RM 3.10(10)
--
-- Designated subtype of A and A (X'Range) and A (Y'Range) is D.
--
-- RM 3.10.2(27/1)
--
-- A's designated subtype shall statically match the nominal subtype
-- of the view.
--
-- RM 4.9.1 (2)
--
-- Statically matching subtypes have statically matching constraints.
--
-- AX: Expected type of X'Access is A.
-- A's designated subtype D does not statically match X's nominal
-- subtype D(1..3).
--
-- BX: Expected type of X'Access is A(X'Range).
-- A(X'Range)'s designated subtype D does not statically match X's
-- nominal subtype D(1..3).
--
-- AY: Expected type of Y'Access is A.
-- A's designated subtype D does statically match Y's nominal subtype D.
--
-- BY: Expected type of Y'Access is A(Y'Range).
-- A(Y'Range)'s designated subtype D does statically match Y's nominal
-- subtype D.
__________________________________________________________
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren! http://freephone.web.de/?mc=021201
next reply other threads:[~2004-11-08 13:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-08 13:34 Christoph Karl Walter Grein [this message]
2004-11-09 16:47 ` String Pointer Bug skidmarks
2004-11-09 19:35 ` Martin Krischik
-- strict thread matches above, loose matches on Subject: below --
2004-11-02 19:32 skidmarks
2004-11-04 6:18 ` Per Sandberg
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox