comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <krischik@users.sourceforge.net>
Subject: Re: Cannot initialize entities of limited type?
Date: Fri, 12 Jan 2007 15:04:28 +0100
Date: 2007-01-12T15:04:28+01:00	[thread overview]
Message-ID: <45a7956e$1@news.post.ch> (raw)
In-Reply-To: <eo83q9$fpi$1@cernne03.cern.ch>

Maciej Sobczak schrieb:
> 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?

You are using a new Ada 2005 feature which your compiler may not yet 
support. Update your compiler or use:

procedure Constructor (X: in out T);

Martin



  reply	other threads:[~2007-01-12 14:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-12 13:52 Cannot initialize entities of limited type? Maciej Sobczak
2007-01-12 14:04 ` Martin Krischik [this message]
2007-01-12 14:28   ` Maciej Sobczak
2007-01-12 15:06     ` Jean-Pierre Rosen
2007-01-12 20:56       ` Simon Wright
2007-01-13 17:39     ` Georg Bauhaus
2007-01-12 19:08   ` Jeffrey Creem
2007-01-12 14:23 ` Jean-Pierre Rosen
2007-01-12 14:26 ` Jeffrey Creem
2007-01-15 23:53 ` Jeffrey Carter
2007-01-16  8:35   ` Maciej Sobczak
2007-01-16 13:56     ` Martin Krischik
replies disabled

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