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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f34f2cf6eacd2bc8,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.156.155 with SMTP id x27mr2185923bkw.7.1319264094557; Fri, 21 Oct 2011 23:14:54 -0700 (PDT) Path: l23ni27682bkv.0!nntp.google.com!news2.google.com!postnews.google.com!u9g2000vby.googlegroups.com!not-for-mail From: Malaise Newsgroups: comp.lang.ada Subject: Private constant of tagged limited controlled type Date: Fri, 21 Oct 2011 23:14:51 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 78.224.49.155 Mime-Version: 1.0 X-Trace: posting.google.com 1319264094 10599 127.0.0.1 (22 Oct 2011 06:14:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 22 Oct 2011 06:14:54 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u9g2000vby.googlegroups.com; posting-host=78.224.49.155; posting-account=52eKqgoAAADWCuSusv9knR2f_28-NAV2 User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110921 Ubuntu/10.04 (lucid) Firefox/3.6.23,gzip(gfe) Xref: news2.google.com comp.lang.ada:14141 Content-Type: text/plain; charset=ISO-8859-1 Date: 2011-10-21T23:14:51-07:00 List-Id: Hello, I have difficulties to initialise a private constant of a tagged type that implements Limited_Controlled. The following complains that "initialization of limited object requires aggregate or function call": with Ada.Finalization; package Pack is type T is tagged limited private; C : constant T; private type T is new Ada.Finalization.Limited_Controlled with record I : Integer := 0; end record; V : T; C : constant T := V; end Pack; Aggregate seems impossible because Limited_Controlled is abstract and anyway T is very complex in fact. A function (returning tagged type) has to be visible and anyway cannot return V (in Ada 2005). Is there any solution other than access type? Thank you