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,aee6065fc75bfcb4 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Overlaying of methods. Date: 1997/10/01 Message-ID: #1/1 X-Deja-AN: 277077257 References: <34310F93.41C6@htl-bw.ch> <343131AC.6D6@bix.com> <34325DA2.41C6@htl-bw.ch> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-10-01T00:00:00+00:00 List-Id: In article <34325DA2.41C6@htl-bw.ch>, Stefan Muehlebach wrote: >But what in this example is abmiguous? ... I think what's confusing you is that you think that the Init operation is overriding the one that is inherited from the parent type. That's not the case in your example, because the two Init's do not have type-conformant parameter profiles. So, your type ends up with *two* things called Init -- one inherited from the parent type, plus a new one. If they're visible, then calls will tend to be ambiguous, because of all the defaults you have. On the other hand, if you're dispatching via the parent types operation, that operation will get called, since it is not overridden. It's hard to understand what's going on without the complete sources -- from what you posted, we can't tell what's visible at the point of the call to Init. If what you're trying to do is override the parent's Init procedure, then just make sure the number and types of parameters (and results, if any) match. And parameter modes and subtypes. (But parameter names and defaults don't have to match.) - Bob