comp.lang.ada
 help / color / mirror / Atom feed
* Cannot initialize entities of limited type?
@ 2007-01-12 13:52 Maciej Sobczak
  2007-01-12 14:04 ` Martin Krischik
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Maciej Sobczak @ 2007-01-12 13:52 UTC (permalink / raw)


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/



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-01-16 13:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-12 13:52 Cannot initialize entities of limited type? Maciej Sobczak
2007-01-12 14:04 ` Martin Krischik
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

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