comp.lang.ada
 help / color / mirror / Atom feed
* problem with polymorphism
@ 1997-11-20  0:00 Henri Delebecque
  1997-11-21  0:00 ` Jon S Anthony
  0 siblings, 1 reply; 2+ messages in thread
From: Henri Delebecque @ 1997-11-20  0:00 UTC (permalink / raw)



Hello,

I'm currently evaluating tagged types in Ada95, and encounter some
problems
with the following code:

type Point is tagged record
        x : integer := 0;
        y : integer := 0;
end record;
type Point3D is new Point with record
        z : integer := 0;
end record;
procedure print (unPoint : in Point) is
begin
        put ("Point:[");
	...
end print;
procedure print (unPoint3D : in Point3D) is
begin
...
end print;
procedure printing (unPoint : in Point'Class) is
begin
        print(unPoint);
end printing;

gnat's error message is
testpoly.adb:40:17: class-wide argument not allowed here
testpoly.adb:40:17: "imprime" is not a primitive operation of "Point"

Please, could someone helps me ?
Thanks
______________________________________________________________
| Henri Delebecque                        delebecq@supelec.fr |
| Webmaster                                                   |
| Supelec                          Tel (33)  01.69.85.14.91   |
| Plateau de Moulon                 Fax:(33) 01.69.85.12.34   |
| 91190 Gif sur Yvette                                        |
| FRANCE                                                      |
|_____________________________________________________________|




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

* Re: problem with polymorphism
  1997-11-20  0:00 problem with polymorphism Henri Delebecque
@ 1997-11-21  0:00 ` Jon S Anthony
  0 siblings, 0 replies; 2+ messages in thread
From: Jon S Anthony @ 1997-11-21  0:00 UTC (permalink / raw)



Henri Delebecque <delebecq@supelec.fr> writes:

> gnat's error message is
> testpoly.adb:40:17: class-wide argument not allowed here
> testpoly.adb:40:17: "imprime" is not a primitive operation of "Point"

Insufficient information.  "imprime" is not in your code snippet and
it is clearly the problem based on the explicit error message...


/Jon

-- 
Jon Anthony
Synquiry Technologies, Ltd., Belmont, MA 02178, 617.484.3383
"Nightmares - Ha!  The way my life's been going lately,
 Who'd notice?"  -- Londo Mollari




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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-20  0:00 problem with polymorphism Henri Delebecque
1997-11-21  0:00 ` Jon S Anthony

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