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,dad94612ff745427 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news.glorb.com!ecngs!feeder.ecngs.de!news.germany.com!news.belwue.de!newsfeed.arcor.de!news.arcor.de!not-for-mail Date: Wed, 10 May 2006 21:01:08 +0200 From: Georg Bauhaus Organization: future apps GmbH User-Agent: Thunderbird 1.5.0.2 (X11/20060420) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Instantiating private types with discriminants? References: <1147252198.138173.203910@j73g2000cwa.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <44623869$0$4504$9b4e6d93@newsread2.arcor-online.net> NNTP-Posting-Date: 10 May 2006 21:00:57 MEST NNTP-Posting-Host: 1da84dc2.newsread2.arcor-online.net X-Trace: DXC=Fk[::=iYbfLC;_l<5e4khAQ5U85hF6f;DjW\KbG]kaMH[NGU2GAcMGJ]aHJc1B;;oHljUVjRQ60?BVmnOeiOY3@Ng[50F7T5IOB X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:4181 Date: 2006-05-10T21:00:57+02:00 List-Id: rick H wrote: > I've now tried declaring Var_A to be... > Var_A : General_T'Class; > > but gnat insists on initialization, and it's here that I tumble. A real object of a class-wide type needs to have a tag, hence if you don't initialize, which tag should it be? Solution: Declare variables or constants where you need them, and where you have assembled everything necessary for their initialization. That is, procedure simple_case is ... begin ... declare var_x: General_T'class := ; begin op(var_x); end; ... end simple_case;