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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6cd0753a57f9edec X-Google-Attributes: gid103376,public From: "Norman H. Cohen" Subject: Re: Resolution of Dispatching Operations Date: 1997/02/25 Message-ID: <33134407.3D4C@watson.ibm.com>#1/1 X-Deja-AN: 221598101 References: Organization: IBM Thomas J. Watson Research Center Reply-To: ncohen@watson.ibm.com Newsgroups: comp.lang.ada Date: 1997-02-25T00:00:00+00:00 List-Id: Matthew Heaney wrote: > 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? ... > On my compiler, the first version gets called, but I have no idea why that > one would be favored over the other. > > 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? It looks like a compile-time overloading ambiguity to me. I think what you're missing is a correct compiler. :-) -- Norman H. Cohen mailto:ncohen@watson.ibm.com http://www.research.ibm.com/people/n/ncohen