comp.lang.ada
 help / color / mirror / Atom feed
From: Jonas Nygren <ehsjony@ehs.ericsson.se>
Cc: report@gnat.com
Subject: Question on renaming of subprogram
Date: 1996/03/25
Date: 1996-03-25T00:00:00+00:00	[thread overview]
Message-ID: <3156745B.6D01@ehs.ericsson.se> (raw)

The following code compiles with Gnat 3.03 but the execution 
goes of in a deep loop. Now I am curious as to if my code is 
correct or not. 

The problem arises when I try to rename a subprogram with a 
subprogram of the same name, in the example below "p". If the 
name of "procedure p(b : tb)" is changed to e.g. "px" it compiles
and executes normally.

So, can I rename a subprogram with a name identical to it's own?
If not, should Gnat have given an error message?

/jonas

PS using a separate package for "tb" does not seem to help.
   Perhaps it has to do with conformance rules. 

   I copy this to report@gnat also: Gnat version: 3.03, Solaris 2.3 DS

-- the code example follows
package tests is
	type ta is private;

	procedure p(a : ta);

	type tb is private;

	procedure p(b : tb);
private
	type ta is access integer;
	type tb is new ta;
	procedure p(b : tb) renames p;
end tests;

package body tests is
	procedure p(a : ta) is
	begin
		null;
	end p;
end tests;

with tests; use tests;
procedure test is
	b : tb;
begin
	p(b);
end test;




                 reply	other threads:[~1996-03-25  0:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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