comp.lang.ada
 help / color / mirror / Atom feed
* argument of conversion cannot be an allocator
@ 1997-05-14  0:00 Dale Stanbrough
  1997-05-14  0:00 ` Peter Hermann
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dale Stanbrough @ 1997-05-14  0:00 UTC (permalink / raw)



I came across the following problem...


	type a is tagged private;
	type a_ptr is access all a'class;
	
	type b is new a with private;
	type b_ptr is acces all b'class;
	
	...
	
	
	return a'(new b);

which results in the error message (from GNAT)

	"argument of conversion cannot be an allocator"

The work around is...

	declare
	   temp : b_Ptr := new b;
	begin
	   return a_ptr(temp);
	end;


I presume there is a good reason for this; can anyone provide enlightenment
on this point (or even a simpler way to accomplish the above)?

Dale




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

end of thread, other threads:[~1997-05-17  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-05-14  0:00 argument of conversion cannot be an allocator Dale Stanbrough
1997-05-14  0:00 ` Peter Hermann
1997-05-16  0:00 ` Dale Stanbrough
1997-05-16  0:00   ` Robert Dewar
1997-05-17  0:00 ` John G. Volan

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