comp.lang.ada
 help / color / mirror / Atom feed
From: Thomas Handler <thandler@systems.at>
Subject: accesibility level problem
Date: 1999/02/19
Date: 1999-02-19T00:00:00+00:00	[thread overview]
Message-ID: <36CD206A.32D96489@systems.at> (raw)

Hi!

I've been experimenting with an interface for one of my packages and how
to make it easy usable for the users of the package and ran into an
accessibility level problem.

My packages are as follows (I'm using GNAT):


channeldef.ads:

package ChannelDef is

   type Channel is abstract tagged null record;
   type PChannel is access all Channel'Class;
   type ChannelArray is array(Positive range <>) of PChannel;

   procedure AwaitChannels(Channels : ChannelArray);

end ChannelDef;

##############################

channeldef.adb:

package body ChannelDef is

   procedure AwaitChannels(Channels : ChannelArray) is
   begin
      null;
   end AwaitChannels;

end ChannelDef;

##############################

channeldef-superchannel.ads:

package ChannelDef.SuperChannel is

   type SuperChannel is new Channel with record
      Super : Boolean;
   end record;

end  ChannelDef.SuperChannel;

##############################

and finally the test program:

with ChannelDef, ChannelDef.SuperChannel;
use ChannelDef, ChannelDef.SuperChannel;

procedure Testme is
   S1 : aliased ChannelDef.SuperChannel.SuperChannel;
   S2 : aliased ChannelDef.SuperChannel.SuperChannel;
begin
   AwaitChannels((S1'Access, S2'Unchecked_Access));
end Testme;

The problem I have now is that I get 

testme.adb:8:19: object has deeper accessibility level than access type

when compiling testme via gnatmake testme. Compiling with GNAT 3.11p
just changes the error message.
Of course S1'Unchecked_Access does the trick.
What I can't understand is that the accessibility level seems to be
bound to the type declaration and not to the actual object and I haven't
found the right place in the RM to point this problem out.
If anyone could help me getting the right direction this would be great.

Thomas Handler




             reply	other threads:[~1999-02-19  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-19  0:00 Thomas Handler [this message]
1999-02-19  0:00 ` accesibility level problem steve quinlan
1999-02-20  0:00   ` robert_dewar
1999-02-20  0:00     ` Steve Quinlan
1999-02-21  0:00       ` robert_dewar
1999-03-01  0:00     ` Robert A Duff
1999-03-02  0:00       ` Thomas Handler
1999-02-21  0:00   ` Thomas Handler
1999-02-21  0:00     ` Steve Quinlan
1999-02-22  0:00       ` robert_dewar
1999-02-22  0:00     ` robert_dewar
1999-02-22  0:00       ` Thomas Handler
replies disabled

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