comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Infinite recursion in Static_Predicate ?
Date: Mon, 22 Jul 2013 20:17:52 +0200
Date: 2013-07-22T20:17:52+02:00	[thread overview]
Message-ID: <op.w0myf2o8ule2fv@cardamome> (raw)

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‑range. 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 =>
              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)


-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University

             reply	other threads:[~2013-07-22 18:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-22 18:17 Yannick Duchêne (Hibou57) [this message]
2013-07-22 19:09 ` Infinite recursion in Static_Predicate ? Anh Vo
2013-07-22 20:09   ` Bill Findlay
replies disabled

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