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: a07f3367d7,146d9a693430fff2 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!a10g2000vbz.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: Ada2012 Invariants and obaque types Date: Tue, 21 Jun 2011 05:01:48 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <239a78ad-0937-4a7a-8163-231430fd5ffe@k27g2000yqn.googlegroups.com> NNTP-Posting-Host: 20.133.0.8 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1308657708 21463 127.0.0.1 (21 Jun 2011 12:01:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 21 Jun 2011 12:01:48 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a10g2000vbz.googlegroups.com; posting-host=20.133.0.8; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESRCNK X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:19977 Date: 2011-06-21T05:01:48-07:00 List-Id: On Jun 21, 12:31=A0pm, Robert A Duff wrote: > I suggest you erase the invariant, fix the errors, and then put the > invariant back in. =A0There's nothing wrong with your invariant. Ok, with no Invariant: package P1 is type T1 is tagged private; function Is_Valid (This : T1) return Boolean; private type Imp; type Imp_Ref is not null access Imp; type T1 is tagged record I : Imp_Ref; end record; end P1; I get: gnatmake -d -PH:\Ada\test_invarients\test_invarients.gpr p1.ads gcc -c -g -g -gnatE -fstack-check -gnato -gnatf -fcallgraph-info=3Dsu,da -gnat12 -I- -gnatA H:\Ada\test_invarients\src\p1.ads cannot generate code for file p1.ads (package spec) gnatmake: "H:\Ada\test_invarients\src\p1.ads" compilation error [2011-06-21 12:58:10] process exited with status 4 (elapsed time: 00.37s) i.e. no error. The most reduced version I can come up with is now: package P1 is type T1 is tagged private with Invariant =3D> True; -- NB: not even a 'real' function private type Imp; type Imp_Ref is not null access Imp; type T1 is tagged record I : Imp_Ref; end record; end P1; which produces the same original error: gnatmake -d -PH:\Ada\test_invarients\test_invarients.gpr p1.ads gcc -c -g -g -gnatE -fstack-check -gnato -gnatf -fcallgraph-info=3Dsu,da -gnat12 -I- -gnatA H:\Ada\test_invarients\src\p1.ads p1.ads:5:04: type "Imp" is frozen at line 2 before its full declaration gnatmake: "H:\Ada\test_invarients\src\p1.ads" compilation error [2011-06-21 13:01:10] process exited with status 4 (elapsed time: 00.53s) -- Martin