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,1c4a54744b1a13e2 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Redefining Integer Type ... Date: 2000/10/18 Message-ID: #1/1 X-Deja-AN: 682859986 Sender: bobduff@world.std.com (Robert A Duff) References: <39ED8FE6.3F7CF3B9@attol-testware.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 2000-10-18T00:00:00+00:00 List-Id: Arnaud de Muyser writes: > I've a little question about operator "+" resolution into > the following pack2-proc.adb procedure. > Why the resolved type (by gnat) is standard.integer whereas > the visible type named Integer is pack.integer (using use clause). Names from outer scopes always take precedence over use-visible names. Everything is nested within Standard. So in your example, Standard.Integer hides Pack.Integer. I don't like that rule -- it's error prone, as you can see. Hiding considered harmful. A good rule of thumb is to never redefine any name (such as Integer) that is declared in Standard, or *could* be declared in Standard (such as Long_Long_Long_Long_Long_Integer). - Bob