From: Vadim Godunko <vgodunko@vipmail.ru>
To: comp.lang.ada@ada.eu.org
Subject: Re: Prefix to 'ACCESS must either statically match... But why?
Date: Mon, 27 Jan 2003 22:30:25 +0300
Date: 2003-01-27T22:30:25+03:00 [thread overview]
Message-ID: <mailman.1.1043696103.30820.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: 5ad0dd8a.0301251431.6370c6bc@posting.google.com
Wojtek Narczynski wrote:
>
> Could somebody please explain me why is this rule present? I find it
> very limting. Is this because AR2 bounds are not stored with the
> object?
>
> Type Stream_Element_Array_access is access all Stream_Element_Array;
>
RM 3.3.1(8): The _subtype_indication_ or full type definition of an
_object_declaration_ defines the nominal subtype of the object. The
_object_declaration_ declares an object of the type of the nominal subtype.
> AR1 : aliased Stream_Element_Array := ( 2, 4, 5 );
AR1 nominal subtype is Stream_Element_Array (<>) of type
Stream_Element_Array (<>)
> AR2 : aliased Stream_Element_Array ( 1 .. 3 ) := ( 2, 4, 5 );
AR2 nominal subtype is Stream_Element_Array (1 .. 3) of type
Stream_Element_Array (<>)
>
> AR1A : Stream_Element_Array_access := AR1'access;
>
> -- Illegal
> AR2A : Stream_Element_Array_access := AR2'access;
>
>
RM/TC1 3.10.2 (24): ... The view denoted by the prefix X shall satisfy
the following additional requirements, presuming the expected type for
the X'Access is the general access type A with designated type D:
RM/TC1 3.10.2 (27/1): ...; if D is untagged, then the type view shall be
D, and A's designated subtype either statically match the nominal
subtype of the view or be discriminanted and unconstrained.
A = Stream_Element_Array_Access
D = Stream_Element_Array (<>)
D - untagged; type of both view is Stream_Element_Array (<>) = D; and
A's designated subtype (Stream_Element_Array (<>)) is discriminanted and
unconstrained.
What's wrong?
Vadim Godunko
next prev parent reply other threads:[~2003-01-27 19:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-25 22:31 Prefix to 'ACCESS must either statically match... But why? Wojtek Narczynski
2003-01-26 9:57 ` Martin Krischik
2003-01-27 19:30 ` Vadim Godunko [this message]
2003-01-28 4:42 ` GNAT / Aonix compiler incompatibility (Was: Prefix to 'ACCESS must either statically match... But why?) Wojtek Narczynski
-- strict thread matches above, loose matches on Subject: below --
2003-01-27 6:41 Prefix to 'ACCESS must either statically match... But why? Grein, Christoph
2003-01-27 18:33 ` Martin Krischik
2003-01-27 19:05 ` Jeffrey Carter
2003-01-27 7:12 Grein, Christoph
2003-01-27 15:46 ` Wojtek Narczynski
2003-01-27 22:32 ` James S. Rogers
2003-01-28 2:51 ` Wojtek Narczynski
2003-01-28 3:19 ` James S. Rogers
2003-01-28 12:14 ` Wojtek Narczynski
2003-01-28 14:43 ` James S. Rogers
2003-01-28 20:20 ` Wojtek Narczynski
2003-01-28 21:36 ` James S. Rogers
2003-01-29 2:09 ` tmoran
2003-01-29 11:21 ` Wojtek Narczynski
2003-01-29 6:50 Grein, Christoph
2003-01-29 11:30 ` Wojtek Narczynski
2003-01-29 11:57 Grein, Christoph
2003-01-29 12:15 Grein, Christoph
2003-01-30 6:20 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