From: Jere <jhb.chat@gmail.com>
Subject: procedure renames creates a primitive operation?
Date: Tue, 29 Aug 2017 08:39:39 -0700 (PDT)
Date: 2017-08-29T08:39:39-07:00 [thread overview]
Message-ID: <bc765307-02bd-4a38-b60c-4b743de6b3e4@googlegroups.com> (raw)
I was curious if this was a bug or intended.
Given the following code:
***************************************************
procedure Main is
package Some_Package is
type Main_Type is tagged null record;
package Non_Primitive_Ops is
procedure Some_Op(Obj : Main_Type) is null;
end Non_Primitive_Ops;
-- without this line, the file correctly generates compiler errors
procedure Some_Op(Obj : Main_Type) renames Non_Primitive_Ops.Some_Op;
end Some_Package;
Var : Some_Package.Main_Type;
package Other_Package is
type Derived_Type is new Some_Package.Main_Type with null record;
-- Should this create a compiler error?
overriding
procedure Some_Op(Obj : Derived_Type) is null;
end Other_Package;
begin
Var.Some_Op; -- Should this create a compiler error?
end Main;
***************************************************
I used a renames clause to bring a non primitive operation
into scope (for client readability when calling the procedure).
However, when I did that, it created a primitive operation.
Is this correct behavior or a bug?
It seems odd that a procedure created through a renames clause
would be primitive, but perhaps it is intended?
next reply other threads:[~2017-08-29 15:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-29 15:39 Jere [this message]
2017-08-29 17:42 ` procedure renames creates a primitive operation? AdaMagica
2017-08-31 1:24 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox