comp.lang.ada
 help / color / mirror / Atom feed
From: Maxim Reznik <max1@mbank.com.ua>
Subject: ambiguous names
Date: Tue, 20 Aug 2002 17:50:20 +0300
Date: 2002-08-20T14:55:34+00:00	[thread overview]
Message-ID: <3D62572C.60309@mbank.com.ua> (raw)

Trying to understand paragraph 4.1.3.13 of ARM:

* If the prefix does not denote a package, then it shall be a 
*direct_name or an expanded name, and it shall resolve to denote a 
*program unit (other than a package), the current instance of a type, a 
*block_statement, a loop_statement, or an accept_statement (in the case 
*of an accept_statement or entry_body, no family index is allowed); the 
*expanded name shall occur within the declarative region of this 
*construct. Further, if this construct is a callable construct and the 
*prefix denotes more than one such enclosing callable construct, then 
*the expanded name is ambiguous, independently of the selector_name.

I wroute a program:

procedure A is
    B : Boolean;
    X : Integer;

    procedure A is
       B : Integer;
    begin
       X := A.B;  -- ambiguous ?
    end A;

begin
    null;
end A;

I think there is an ambiguous name A.B in assignment statement.
"A" denotes two procedures and they are callable constructs.
But GNAT doesnt complain.

Could Ada lawyers explain me my fault and/or give me an example
of ambiguity of a prefix?

Please





             reply	other threads:[~2002-08-20 14:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-20 14:50 Maxim Reznik [this message]
2002-08-20 15:15 ` ambiguous names David C. Hoos
2002-08-20 17:55   ` Pascal Obry
2002-08-21  7:05   ` Maxim Reznik
replies disabled

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