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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ucbvax!sdcsvax!telesoft!keith From: keith@telesoft.UUCP Newsgroups: comp.lang.ada Subject: Re: language problem Message-ID: <399@telesoft.UUCP> Date: Tue, 7-Apr-87 20:11:54 EST Article-I.D.: telesoft.399 Posted: Tue Apr 7 20:11:54 1987 Date-Received: Sat, 11-Apr-87 03:32:36 EST References: <1044@cullvax.UUCP> Organization: TeleSoft, SanDiego CA List-Id: Dale Worley at Cullinet Software writes: > Is the following program required to raise CONSTRAINT_ERROR (or whatever)? > > procedure y is > subtype x is range 0..100; > a : x := 100; > begin > a := a + 1; > end y; > First, our compiler points out the error: 2: subtype x is range 0..100; ------- >>> Replaced underlined text by " type " So, making that suggested modification results in correct compilation with the runtime result: >>> Unhandled exception: CONSTRAINT_ERROR (Range Check) Raised in Y.Y at line 5 So, yes, absolutely, constraint_error should be raised. I assert that you meant either type x is range 0..100; or subtype x is integer range 0..100; for the purposes of the question, the differences are immaterial. Keith -- Keith Allan Shillington telesoft!keith@UCSD.ARPA 619/457-2700x388.ATT My opinions are mine. {ucbvax!sdcsvax,hp-sdd,bigbang}!telesoft!keith.UUCP