comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Ambiguity detected - Why?
Date: 1996/06/06
Date: 1996-06-06T00:00:00+00:00	[thread overview]
Message-ID: <DsK337.3xD@world.std.com> (raw)
In-Reply-To: 31B590D2.4193@dial.eunet.ch


In article <31B590D2.4193@dial.eunet.ch>,
Alan Paterson  <paterson@dial.eunet.ch> wrote:
>The following results when compiling using DECAda/VMS. We cannot understand why 
>the compiler finds the marked call ambiguous. Can anyone explain it?

>     22    PROC((A, B));
>...............1
>%ADAC-E-AMBIGRSL, (1) Ambiguity detected during overload resolution [LRM 8.7]

The type of an aggregate must be determined by the surrounding context.
The compiler is not allowed to look inside the aggregate in order to
determine its type.  In Ada 95, this is 4.3(3).  There's an equivalent
rule in Ada 83, worded differently.  The compiler thinks, OK I've got an
aggregate, so it must be of some composite type, but I don't know which
composite type, since I'm not allowed to look inside the aggregate.  But
I've got two different things called PROC, which both take a parameter
of a composite type, so I've got an ambiguity.

No big deal -- just use a qualified expression to tell the compiler what
type you meant.

- Bob




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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-05  0:00 Ambiguity detected - Why? Alan Paterson
1996-06-06  0:00 ` Robert A Duff [this message]
1996-06-06  0:00 ` Adam Beneschan
replies disabled

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