comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pogner.demon.co.uk>
Subject: new type'class'() legal?
Date: 1996/12/02
Date: 1996-12-02T00:00:00+00:00	[thread overview]
Message-ID: <x7vk9r0n0z5.fsf@pogner.demon.co.uk> (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;




             reply	other threads:[~1996-12-02  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-12-02  0:00 Simon Wright [this message]
1996-12-03  0:00 ` new type'class'() legal? Tucker Taft
1996-12-10  0:00 ` Paul Chardon
replies disabled

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