comp.lang.ada
 help / color / mirror / Atom feed
From: Christoph Grein <christoph.grein@eurocopter.com>
Subject: Re: Renaming subprogram and default_expression
Date: Fri, 15 Feb 2002 06:38:44 +0100 (MET)
Date: 2002-02-15T06:38:44+01:00	[thread overview]
Message-ID: <mailman.1013751607.11042.comp.lang.ada@ada.eu.org> (raw)

> 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;



             reply	other threads:[~2002-02-15  5:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-15  5:38 Christoph Grein [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-02-14 11:52 Renaming subprogram and default_expression Christoph Grein
2002-02-14 12:04 ` Florian Weimer
2002-02-14 12:46   ` Lutz Donnerhacke
2002-02-14 13:15     ` Florian Weimer
2002-02-14 14:01   ` Alexander Boucke
2002-02-14 15:18     ` Florian Weimer
2002-02-14 15:46       ` Alexander Boucke
2002-02-14 15:58         ` Florian Weimer
2002-02-14 16:24           ` Alexander Boucke
2002-02-14 16:31           ` Larry Hazel
2002-02-14 16:35           ` Florian Weimer
2002-02-15  8:40             ` Lutz Donnerhacke
2002-02-14 10:51 Florian Weimer
2002-02-14 11:31 ` sk
replies disabled

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