From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9640b17421044f1a,start X-Google-Attributes: gid103376,public From: Thomas Handler Subject: accesibility level problem Date: 1999/02/19 Message-ID: <36CD206A.32D96489@systems.at>#1/1 X-Deja-AN: 446010790 Content-Transfer-Encoding: 7bit Organization: SYSTEMS AG Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-02-19T00:00:00+00:00 List-Id: 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