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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,100eb0a59892e906 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!17g2000hsk.googlegroups.com!not-for-mail From: Sven Newsgroups: comp.lang.ada Subject: Re: How to pass around access types to interfaces? Date: Fri, 24 Oct 2008 05:49:36 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <4901be81$0$23607$4f793bc4@news.tdc.fi> NNTP-Posting-Host: 93.129.126.248 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1224852577 26666 127.0.0.1 (24 Oct 2008 12:49:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 24 Oct 2008 12:49:37 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 17g2000hsk.googlegroups.com; posting-host=93.129.126.248; posting-account=oTiqeAoAAAAm9MRakyssPfX9BEL3QpPS User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; de-de) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:2486 Date: 2008-10-24T05:49:36-07:00 List-Id: > I assume this type declaration is in the main *procedure*. This > means that the type has a local scope and life, which prevents > converting its values to a more long-lived access type. Try > declaring Concrete_Type in a package; that makes it live as long as > the whole program, and should allow such conversions. Yeah, the declaration was in the main procedure. When moving it to a package everything works like it's supposed to. Thanks for your help. I guess I have still a lot to learn about Ada. I was just thinking about the lifetime of the object. It never occured to me that a type also has a lifetime.