* Access type scope
@ 2001-07-20 15:54 Lin
2001-07-21 19:19 ` David C. Hoos, Sr.
0 siblings, 1 reply; 2+ messages in thread
From: Lin @ 2001-07-20 15:54 UTC (permalink / raw)
When I compile the main program below, the error message is "type
extension at deeper accessibility level than parent". How can I deal
with it if I need the extension? Any clues about it? Many Thanks.
--Lin
--------------------------------
with System.RPC; use System.RPC;
with test;
procedure main is
procedure Fred(Y: access Params_Stream_Type) is
type APS is access all System.RPC.Params_Stream_Type;
type msg_type is new test.Msg_Type with
record
params : APS;
end record;
X : APS;
Msg : msg_type;
begin
Msg := (
test.Msg_Type with
params => APS (Y));
X := APS(Y);
end Fred;
PS : aliased Params_Stream_Type(0);
begin
Fred(PS'access);
end main;
with System.RPC;
package test is
type Msg_Type is tagged
record
From_Par_Id : System.RPC.Partition_ID;
end record;
end test;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Access type scope
2001-07-20 15:54 Access type scope Lin
@ 2001-07-21 19:19 ` David C. Hoos, Sr.
0 siblings, 0 replies; 2+ messages in thread
From: David C. Hoos, Sr. @ 2001-07-21 19:19 UTC (permalink / raw)
To: comp.lang.ada; +Cc: Lin
You need to declare your type extension at library level e.g.,
in a package or in a library-level subprogram, instead of in
a procedure nested within a library-level procedure.
----- Original Message -----
From: "Lin" <Lin@post.com>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: July 20, 2001 10:54 AM
Subject: Access type scope
> When I compile the main program below, the error message is "type
> extension at deeper accessibility level than parent". How can I deal
> with it if I need the extension? Any clues about it? Many Thanks.
>
> --Lin
>
> --------------------------------
> with System.RPC; use System.RPC;
> with test;
> procedure main is
> procedure Fred(Y: access Params_Stream_Type) is
> type APS is access all System.RPC.Params_Stream_Type;
> type msg_type is new test.Msg_Type with
> record
> params : APS;
> end record;
> X : APS;
> Msg : msg_type;
> begin
> Msg := (
> test.Msg_Type with
> params => APS (Y));
> X := APS(Y);
> end Fred;
> PS : aliased Params_Stream_Type(0);
> begin
> Fred(PS'access);
> end main;
>
> with System.RPC;
> package test is
> type Msg_Type is tagged
> record
> From_Par_Id : System.RPC.Partition_ID;
> end record;
> end test;
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-07-21 19:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-20 15:54 Access type scope Lin
2001-07-21 19:19 ` David C. Hoos, Sr.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox