From: Philippe Tarroux <philippe.tarroux@limsi.fr>
Subject: Dot notation in Ada 2005
Date: Fri, 19 May 2006 12:14:05 +0200
Date: 2006-05-19T12:14:05+02:00 [thread overview]
Message-ID: <e4k5l2$i1d$2@upsn250.cri.u-psud.fr> (raw)
I am testing some features of the new Ada 2005 version. Here a simple
problem that seems to me rather a gnat bug than a limitation of the
norm. With the code:
------
package Objs is
type Point is tagged null record;
end Objs;
------
package Objs.ext_objs is
type New_Point is new Point With private;
function X (P : New_Point) return Integer;
private
type New_Point is new Point with record
X1, Y1 : Integer := 0;
end record;
end Objs.ext_objs;
------
package body Objs.Ext_Objs is
function X (P : New_Point) return Integer is
begin
return P.X1;
end X;
procedure Test ( A : Integer; Y : Integer) is
begin
null;
end Test;
procedure Draw (A : Integer; P : New_Point) is
begin
Test (A, P.X); -- PROBLEM HERE
end Draw;
end Objs.Ext_Objs;
i get a compilation error ("no selector X for private type P") when P.X
is not the first argument of the function Test.
It seems to me a rather strange behavior.
Some explanation?
Philippe Tarroux
next reply other threads:[~2006-05-19 10:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-19 10:14 Philippe Tarroux [this message]
2006-05-20 12:16 ` Dot notation in Ada 2005 Martin Carlisle
2006-05-22 6:50 ` Philippe Tarroux
2006-05-22 8:19 ` Marc Enzmann
2006-05-22 10:33 ` christoph.grein
2006-05-22 11:09 ` Marc Enzmann
2006-05-23 15:02 ` Martin Carlisle
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox