* Accessibility level of a record extension????
@ 2000-10-26 22:03 Pawe� Niewiadomski
0 siblings, 0 replies; only message in thread
From: Pawe� Niewiadomski @ 2000-10-26 22:03 UTC (permalink / raw)
Here is a prototype of my queue package:
-- Program 9.8 Full priority-queue ADT
with ada.finalization; use ada.finalization;
generic
type item_type is private;
null_item : item_type;
with function "<" (x,y: item_type) return boolean is <>;
package g_class_dllist_priority_queue is
type handle_type is private;
type queue is limited private;
function empty(pq: queue) return boolean;
procedure insert(pq: in out queue; item: in item_type;
handle: out handle_type);
procedure getmax(pq: in out queue; item: out item_type);
procedure change(handle: in handle_type; item: in item_type);
procedure remove(handle: in out handle_type);
procedure join(pq1,pq2: in out queue);
private
type node;
type link is access node;
type handle_type is new link;
type node is record
item: item_type;
prev, next: link;
end record;
type queue is new limited_controlled with record
head, tail: link;
end record;
procedure initialize(pq: in out queue);
end g_class_dllist_priority_queue;
and here is the program I want to test the package with:
with ada.text_io, g_class_dllist_priority_queue, dodatki;
use ada.text_io, dodatki;
procedure testuj is
subtype str20 is string (1..20);
null_str: str20:=(1..20=>' ');
package queues is new g_class_dllist_priority_queue (str20, null_str,
"<");
use queues;
pq: queue;
s: str20;
handle: handle_type;
begin
...
...
end testuj;
The compiler displays the following error:
testowanie_kolejki_lista.adb: Error: line 6 col 79 LRM:3.9.1(3), The
accessibility level of a record extension shall not exceed that of its
parent; this also applies in a generic instantiation
(In instance of generic g_class_dllist_priority_queue at
program_09_08.ada: line 25 col 8)
the error is caused by the package instantiation. I would be grateful if
someone could explain what it means. I have tried searching in Reference
Manual, but as I am not experienced in Ada programming, the explanation
given by the RM is not clear enough for me.
Thanks in advance
Pawel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-10-26 22:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-26 22:03 Accessibility level of a record extension???? Pawe� Niewiadomski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox