From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,56ea95ca210cf316 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Ambiguity detected - Why? Date: 1996/06/06 Message-ID: #1/1 X-Deja-AN: 158707841 references: <31B590D2.4193@dial.eunet.ch> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-06-06T00:00:00+00:00 List-Id: In article <31B590D2.4193@dial.eunet.ch>, Alan Paterson 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