comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: non-local pointer cannot point to local object
Date: Fri, 23 Feb 2018 04:19:23 -0800 (PST)
Date: 2018-02-23T04:19:23-08:00	[thread overview]
Message-ID: <e70042d6-d667-45c5-bb82-d77b5113cf45@googlegroups.com> (raw)
In-Reply-To: <15e8a72b-3644-4193-8947-b0aaf587c1c2@googlegroups.com>

Am Freitag, 23. Februar 2018 09:54:28 UTC+1 schrieb art...@nihamkin.com:
> Can someone explain why I get "non-local pointer cannot point to local object" error, even though it looks like "Arr" and "Arr_Access" have the same accessibility level?

Just a little example:

  type Pointer is access Integer;
  Long: Pointer;
  declare
    Local: aliased Integer := -42;
    Short: Pointer := Local'Access;  -- illegal
  begin
    Long := Short;
  end;
  -- If this were legal, Long would point to a nonexistent object

  parent reply	other threads:[~2018-02-23 12:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23  8:54 non-local pointer cannot point to local object artium
2018-02-23  9:22 ` J-P. Rosen
2018-02-24  8:13   ` gautier_niouzes
2018-02-23  9:42 ` Dmitry A. Kazakov
2018-02-23 12:19 ` AdaMagica [this message]
2018-02-23 16:56   ` Mehdi Saada
2018-02-23 17:16     ` Dmitry A. Kazakov
replies disabled

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