comp.lang.ada
 help / color / mirror / Atom feed
* procedure renames creates a primitive operation?
@ 2017-08-29 15:39 Jere
  2017-08-29 17:42 ` AdaMagica
  2017-08-31  1:24 ` Randy Brukardt
  0 siblings, 2 replies; 3+ messages in thread
From: Jere @ 2017-08-29 15:39 UTC (permalink / 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?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-31  1:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29 15:39 procedure renames creates a primitive operation? Jere
2017-08-29 17:42 ` AdaMagica
2017-08-31  1:24 ` Randy Brukardt

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