comp.lang.ada
 help / color / mirror / Atom feed
* Infinite recursion in Static_Predicate ?
@ 2013-07-22 18:17 Yannick Duchêne (Hibou57)
  2013-07-22 19:09 ` Anh Vo
  0 siblings, 1 reply; 3+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2013-07-22 18:17 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-22 20:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-22 18:17 Infinite recursion in Static_Predicate ? Yannick Duchêne (Hibou57)
2013-07-22 19:09 ` Anh Vo
2013-07-22 20:09   ` Bill Findlay

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