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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: type definition for an integer with discrete range Date: Mon, 01 Apr 2019 17:27:29 +0100 Organization: A noiseless patient Spider Message-ID: References: <36c2ff61-8cca-4435-995f-dfc34fa44b69@googlegroups.com> <511923fb-dbb9-4e33-82a8-b4bbbf002a6d@googlegroups.com> <5762bd48-9e87-4b77-a517-a4e62dec071b@googlegroups.com> <83811f34-a797-455c-9909-e5641a88a285@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="49682f3677f1320f1886899acbd93bde"; logging-data="10921"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX192aqmsI+XKiXizhpw+VOHV3XGhHqYs8l8=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (darwin) Cancel-Lock: sha1:vikoLVm+lHC1F9/0N4hj07Po35Q= sha1:Y8K5GdATob0uXmkvlj7a6VwkWoM= Xref: reader01.eternal-september.org comp.lang.ada:56027 Date: 2019-04-01T17:27:29+01:00 List-Id: AdaMagica writes: > Am Montag, 1. April 2019 08:59:56 UTC+2 schrieb mario.b...@gmail.com: >> Thanks, it is nearly perfect now :-) >> The line 24 in the file >> https://github.com/Blunk-electronic/ada_training/blob/master/src/type_angle/type_angle.adb >> Should produce an error at compile time. Apart from this "nice to >> have" the program does what I want. > > You have to make sure that "pragma Assertion_Policy (Check);" is set. Yes, that's why it appears at the top of the program. Alternatively you could compile with -gnata. If I have the Assertion_Policy pragma in spec A, and package B uses that spec, are the assertions specified in A applied in B? (I suspect not)