From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: Dispatching Example
Date: Tue, 04 Sep 2001 12:55:44 +0200
Date: 2001-09-04T12:55:44+02:00 [thread overview]
Message-ID: <3B94B330.15C04CE@nbi.dk> (raw)
In-Reply-To: G9Nk7.77$K35.2047@news.pacbell.net
Ed:
> 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?
Since both:
C := T2'Class (Q);
and
C := T1'Class (B);
are legal, the compiler can not possibly figure out which
of the two "Is_Item" functions you refer to. If you want
the compiler to do a static resolution, you have to
specify which type the class-wide variable should be
treated as having:
T1 (C) := Is_Item;
> end Dispatching_Examples_Driver;
Jacob
--
"Then, after a second or so, nothing continued to happen."
next prev parent reply other threads:[~2001-09-04 10:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-03 15:16 Dispatching Example Ed Colbert
2001-09-04 10:55 ` Jacob Sparre Andersen [this message]
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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox