comp.lang.ada
 help / color / mirror / Atom feed
* changing rules for anonymous access types to named ones
@ 2018-04-02 16:39 Jean-Claude Rostaing
  2018-04-02 18:04 ` Jere
  0 siblings, 1 reply; 6+ messages in thread
From: Jean-Claude Rostaing @ 2018-04-02 16:39 UTC (permalink / raw)


Hi.
There's definitely a change in rules from 95 to 2012 I spotted, which makes things more ugly:
that: Set(new Plus_Operator);
was written for ada95. Now, it gives the error:
expected type "TOKEN_ACCESS" defined at expressions.ads:22
found type access to "Plus_Operator" defined at line 48
TOKEN_ACCESS is merely a named access type to TOKEN_TYPE'class, which PLUS_OPERATOR is a child of.

I made a compilable exemple of my case:

with ada.Text_IO;
use ada.Text_IO;
procedure ESSAI is
   type A is abstract tagged limited null record;
   type A_Child is new A with null record;
   type pointers_A is access A'CLASS;
   type B is interface;
   type B_child is new B with null record;
   type pointers_B is access b'CLASS;
   function F1 (obj: pointers_A) return INTEGER is (1);
   function F2 (obj: pointers_b) return INTEGER IS (1);
begin
   PUT_LINE("avec abstract tagged null record : " & INTEGER'IMAGE(F1(new A_child));
   Put_Line("AVEC interface : " & INTEGER'IMAGE(F2(new B_child));
end;

Only the second statement fails. I could find nothing in the access type section related to interface nor the reciprocal so I'm sure it's not normal.

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

end of thread, other threads:[~2018-04-03 12:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-02 16:39 changing rules for anonymous access types to named ones Jean-Claude Rostaing
2018-04-02 18:04 ` Jere
2018-04-02 21:09   ` Jean-Claude Rostaing
2018-04-03  8:41     ` Dmitry A. Kazakov
2018-04-03 11:29       ` Jean-Claude Rostaing
2018-04-03 12:44         ` Dmitry A. Kazakov

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