comp.lang.ada
 help / color / mirror / Atom feed
From: Henri Delebecque <delebecq@supelec.fr>
Subject: problem with polymorphism
Date: 1997/11/20
Date: 1997-11-20T00:00:00+00:00	[thread overview]
Message-ID: <651n1d$e7p@prof.ese-metz.fr> (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                                                      |
|_____________________________________________________________|




             reply	other threads:[~1997-11-20  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-11-20  0:00 Henri Delebecque [this message]
1997-11-21  0:00 ` problem with polymorphism Jon S Anthony
replies disabled

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