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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Infinite recursion in Static_Predicate ? Date: Mon, 22 Jul 2013 20:17:52 +0200 Organization: Ada @ Home Message-ID: NNTP-Posting-Host: bjycZaza/lyqwgzagmr4fQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:16470 Date: 2013-07-22T20:17:52+02:00 List-Id: Hi people, Can't guess what I'm doing wrong. I wanted to defined a scalar type from= = another, with fine restriction than the classic sub=E2=80=91range. That'= s one of = the things static predicates are for. Checking if it's me or the compiler, I just tried this tiny samples from= http://ada-dk.org/2013/04/superbtypes-in-ada-2012-part-1/ and get the same error with this sample. Sample: type Day is (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday); type T_Day is new Day with Static_Predicate =3D> T_Day in Tuesday | Thursday; Error: warning: attribute Valid requires a predicate check warning: and will result in infinite recursion expression does not have required form for static predicate i386-linux-gnu-gnatmake: compilation error Is this a compiler bug or some subtle changes in the RM I'm not aware of= ? = (and neither the author of ada-dk.org) -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity