comp.lang.ada
 help / color / mirror / Atom feed
From: "Grein, Christoph" <christoph.grein@eurocopter.com>
To: comp.lang.ada@ada.eu.org
Subject: Re: Prefix to 'ACCESS must either statically match... But why?
Date: Wed, 29 Jan 2003 13:15:27 +0100 (MET)
Date: 2003-01-29T13:15:27+01:00	[thread overview]
Message-ID: <mailman.10.1043842974.30820.comp.lang.ada@ada.eu.org> (raw)

> 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?

This is my exegesis. I admit, the whole theme is quite obscure...

AR1 nominal subtype Stream_Element_Array, constrained by initial value to actual 
subtype Stream_Element_Array (1 .. 3).

AR2 nominal and actual subtype Stream_Element_Array (1 .. 3).

So for AR1, nominal subtypes statically match, for AR2, they don't.
It's the nominal subtypes that have to match, not the actual ones.

See RM 3.3.1(8,9), 3.10(10), 3.10.2(27/1), 4.9.1(2).

Gnat 3.16w seems to have a problem here.



             reply	other threads:[~2003-01-29 12:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-29 12:15 Grein, Christoph [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-01-30  6:20 Prefix to 'ACCESS must either statically match... But why? Grein, Christoph
2003-01-29 11:57 Grein, Christoph
2003-01-29  6:50 Grein, Christoph
2003-01-29 11:30 ` Wojtek Narczynski
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-27  6:41 Grein, Christoph
2003-01-27 18:33 ` Martin Krischik
2003-01-27 19:05 ` Jeffrey Carter
2003-01-25 22:31 Wojtek Narczynski
2003-01-26  9:57 ` Martin Krischik
2003-01-27 19:30 ` Vadim Godunko
replies disabled

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