comp.lang.ada
 help / color / mirror / Atom feed
* new type'class'() legal?
@ 1996-12-02  0:00 Simon Wright
  1996-12-03  0:00 ` Tucker Taft
  1996-12-10  0:00 ` Paul Chardon
  0 siblings, 2 replies; 3+ messages in thread
From: Simon Wright @ 1996-12-02  0:00 UTC (permalink / raw)



The code below compiles fine on Gnat 3.07, various platforms, but
fails on Academic AdaMagic and ObjectAda (the demo version) at the
point indicated with "e has no possible interpretation as an
expression of the expected type base'class".

I hope Gnat is right?

(in case you're wondering why I wrote it this way, the original code
has derived types ext1, ext2 which are each the root of a tree of
derived types, and which have sufficiently different properties that I
wanted to make sure that the appropriate proc() was called).

--
package classp is
  type base is tagged null record;
  type base_p is access base'class;
  type ext is new base with null record;
  procedure proc (e : ext'class);
end classp;
package body classp is
  p : base_p;
  procedure proc (e : ext'class) is
  begin
    p := new base'class'(e);
-------------------------^
  end proc;
end classp;




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

end of thread, other threads:[~1996-12-10  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-12-02  0:00 new type'class'() legal? Simon Wright
1996-12-03  0:00 ` Tucker Taft
1996-12-10  0:00 ` Paul Chardon

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