comp.lang.ada
 help / color / mirror / Atom feed
* Dispatching Example
@ 2001-09-03 15:16 Ed Colbert
  2001-09-04 10:55 ` Jacob Sparre Andersen
  2001-09-04 21:30 ` Tucker Taft
  0 siblings, 2 replies; 7+ messages in thread
From: Ed Colbert @ 2001-09-03 15:16 UTC (permalink / raw)


Hi All,

Below is a simplified example from Richard Riehle's & my course on Ada.
GNAT v3.13p says that the call Is_Item is an mbiguous expression, and
ObjectAda v 7.2 says the statement is illegal based on LRM 5.2(6).  Both
Richard and I thought that the expression is tag indeterminate, LRM
3.9.2(6), and would static resolved, LRM 3.9.2(19).  Are Richard and I
missing something or are both compilers wrong?


package Dispatching_Examples
is
  type T1 is tagged private;
  function Is_Item return T1;

  type T2 is new T1 with private;
  function Is_Item return T2;

private
   -- full definition of T1 and T2
  type T1 is tagged null record;
  type T2 is new T1 with null record;
end Dispatching_Examples;


with Dispatching_Examples;
use Dispatching_Examples;
procedure Dispatching_Examples_Driver is
    A, B : T1;                    -- simple variables
    Q, R : T2;                    -- simple variables
    C    : T1'Class := A;     -- class-wide variable
    D    : T2'Class := R ;    -- class-wide variable
begin
    C := Is_Item ;              -- static resolution?
end Dispatching_Examples_Driver;












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

end of thread, other threads:[~2001-09-10  0:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-03 15:16 Dispatching Example Ed Colbert
2001-09-04 10:55 ` Jacob Sparre Andersen
2001-09-04 21:30 ` Tucker Taft
2001-09-04 22:18   ` Pat Rogers
2001-09-05 16:02     ` Tucker Taft
2001-09-05 21:19       ` Florian Weimer
2001-09-10  0:50   ` Ed Colbert

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