From: Maciej Sobczak <no.spam@no.spam.com>
Subject: Cannot initialize entities of limited type?
Date: Fri, 12 Jan 2007 14:52:09 +0100
Date: 2007-01-12T14:52:09+01:00 [thread overview]
Message-ID: <eo83q9$fpi$1@cernne03.cern.ch> (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/
next reply other threads:[~2007-01-12 13:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-12 13:52 Maciej Sobczak [this message]
2007-01-12 14:04 ` Cannot initialize entities of limited type? 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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox