comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Resolution of Dispatching Operations
Date: 1997/02/26
Date: 1997-02-26T00:00:00+00:00	[thread overview]
Message-ID: <E68E1w.Bsn.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: mheaney-ya023680002302970035510001@news.ni.net


Matthew Heaney (mheaney@ni.net) wrote:
: I have a question about the rules for resolution of (dispatching) operations.

: I have a type with 2 operations that differ only with respect to whether
: the arguments are class-wide or specific:

: procedure Op (L : in T; R : in out T'Class);

: procedure Op (L : in T'Class; R : in out T);


: If I'm in a context where I have 2 class-wide objects and I call Op, which
: version of Op gets called?  Like this

: declare
:    O1, O2 : T'Class;
: begin
:    Op (O1, O2);
: end;

: On my compiler, the first version gets called, but I have no idea why that
: one would be favored over the other.

The compiler has a bug.  It should report the call (at compile-time)
as being ambiguous.

: My expectation is that at some point, either at compile-time or at
: run-time, I would get an error that says the compiler couldn't figure out
: which operation I meant.  What am I missing?

A bug-free compiler ;-).

: ...
: Matthew Heaney
: Software Development Consultant
: <mailto:matthew_heaney@acm.org>
: (818) 985-1271

-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA




      parent reply	other threads:[~1997-02-26  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-23  0:00 Resolution of Dispatching Operations Matthew Heaney
1997-02-24  0:00 ` Robert A Duff
1997-02-25  0:00 ` Norman H. Cohen
1997-02-26  0:00 ` Tucker Taft [this message]
replies disabled

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