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,31b3d1f7b3516357,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed-0.progon.net!progon.net!news-zh.switch.ch!switch.ch!cernne03.cern.ch!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Cannot initialize entities of limited type? Date: Fri, 12 Jan 2007 14:52:09 +0100 Organization: CERN News Message-ID: NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Trace: cernne03.cern.ch 1168609929 16178 137.138.37.241 (12 Jan 2007 13:52:09 GMT) X-Complaints-To: news@@cern.ch NNTP-Posting-Date: Fri, 12 Jan 2007 13:52:09 +0000 (UTC) User-Agent: Thunderbird 1.5.0.9 (X11/20061220) Xref: g2news2.google.com comp.lang.ada:8113 Date: 2007-01-12T14:52:09+01:00 List-Id: Hi, procedure Hello is package P is type T is limited private; function Constructor return T; private type T is new Integer; end P; package body P is function Constructor return T is begin return 7; end Constructor; end P; X : P.T := P.Constructor; -- line 17 begin null; end Hello; $ gnatmake hello gcc -c hello.adb hello.adb:17:16: cannot initialize entities of limited type gnatmake: "hello.adb" compilation error $ I got lost. What's wrong in the code above? -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/