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,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,28dcfc3d6dc519b8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-14 21:40:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!isdnet!enst!enst.fr!not-for-mail From: Christoph Grein Newsgroups: comp.lang.ada Subject: Re: Renaming subprogram and default_expression Date: Fri, 15 Feb 2002 06:38:44 +0100 (MET) Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-Trace: avanie.enst.fr 1013751608 55294 137.194.161.2 (15 Feb 2002 05:40:08 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 15 Feb 2002 05:40:08 +0000 (UTC) Return-Path: Content-MD5: JvJOlPfEvxnVWrOiq9vPEA== X-Mailer: dtmail 1.2.1 CDE Version 1.2.1 SunOS 5.6 sun4u sparc Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.8 Precedence: bulk X-Reply-To: Christoph Grein List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:20033 Date: 2002-02-15T06:38:44+01:00 > package Defaults is > > procedure Original (X : Integer); <--- (1) declaration > procedure Renamed (X : Integer := -1); <--- (2) declaration > > private > > procedure Renamed (X : Integer := -1) <--- (3) renaming declaration > renames Original; > > end Defaults; > > the declaration is needed, and you get the error. Looks like a bug. The above exegesis is wrong. There is no bog here, the compiler is correct. The following is the original. Please note the difference. While (3) is a renaming declaration that is illegal at this place because there is a conflictiog declaration (2), (3') is a renaming as body, completing the declaration (2'). If you remove (2'), (3') becomes a renaming declaration. > type Typ is new Integer; > > procedure Original (X : Typ); <--- (1') declaration > procedure Renamed (X : Typ := -1); <--- (2') declaration > > procedure Renamed (X : Typ := -1) <--- (3') renaming as body > renames Original; > > procedure Original (X : Typ) is <--- proper body > begin > null; > end Original; > > begin > null; > end Defaults;