comp.lang.ada
 help / color / mirror / Atom feed
* Question on renaming of subprogram
@ 1996-03-25  0:00 Jonas Nygren
  0 siblings, 0 replies; only message in thread
From: Jonas Nygren @ 1996-03-25  0:00 UTC (permalink / raw)
  Cc: report

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;




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-03-25  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-03-25  0:00 Question on renaming of subprogram Jonas Nygren

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