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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e3c7ee8cd1d3f414 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: rep clause in generics Date: 1997/03/14 Message-ID: #1/1 X-Deja-AN: 225859470 References: <01bc3057$61a78db0$81946482@vkpc131> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-03-14T00:00:00+00:00 List-Id: Jonas asks <) of Element_Type; pragma Pack (Buffer_Type); for Buffer_Type'Component_Size use Element_Type'Size; -- line 9 end Gen_Buffers; The compiler complained with: gen_buffers.ads:9:39: static integer expression required here I thought that Element_Type'Size was a static integer expression. Am I or the compiler in error? >> The compiler is correct, this is obviously NOT a static expression. Remember a static expression is not an expression which seems to you to be something that the compiler should be able to evaluate at compile time. There are very specific rules, and this does not obey them. So when you say to yourself "I thought that ... was a static expression", you need to go to the set of rules, and see if they conform to your thought! In this case they don't, you cannot find a rule that says that this expression is static. An expression is non-static unless there is a very specific rule in the RM that says that it is static.