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!r21g2000pri.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: Ada2012 Invariants and obaque types Date: Wed, 22 Jun 2011 06:57:19 -0700 (PDT) Organization: http://groups.google.com Message-ID: <56d9237f-5d58-42e7-af7a-9d24a1bc3d37@r21g2000pri.googlegroups.com> References: <77766f76-d984-4173-bc7e-defe2b99a262@glegroupsg2000goo.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 1308751040 1362 127.0.0.1 (22 Jun 2011 13:57:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 22 Jun 2011 13:57:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r21g2000pri.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:20005 Date: 2011-06-22T06:57:19-07:00 List-Id: On Jun 22, 11:39=A0am, Egil H=F8vik wrote: > > Example: > > package P1 is > > =A0 =A0type T1 is tagged private > > =A0 =A0 =A0 with Invariant =3D> Is_Valid (T1); > > I believe it's called Type_Invariant, not just Invariant. > > =A0http://www.ada-auth.org/standards/12rm/html/RM-7-3-2.html#I3544 Sadly, that still didn't help: package P1 is type T1 is tagged private with Type_Invariant =3D> True; private type Imp; type Imp_Ref is not null access Imp; type T1 is tagged record I : Imp_Ref; end record; end P1; Results in: 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-22 14:53:53] process exited with status 4 (elapsed time: 16.29s) Thanks anyway. -- Martin p.s. I got 'Invariant' from the AI...must now remember that AI's are not always the 'latest-and-greatest'!