comp.lang.ada
 help / color / mirror / Atom feed
From: keith@telesoft.UUCP
Subject: Re: language problem
Date: Tue, 7-Apr-87 20:11:54 EST	[thread overview]
Date: Tue Apr  7 20:11:54 1987
Message-ID: <399@telesoft.UUCP> (raw)
In-Reply-To: 1044@cullvax.UUCP

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

  reply	other threads:[~1987-04-08  1:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1987-04-07  5:53 language problem drw
1987-04-08  1:11 ` keith [this message]
  -- strict thread matches above, loose matches on Subject: below --
1987-04-08 18:08 drw
1987-04-03 10:35 ms8k#
     [not found] <12291366595.33.BRYAN@Sierra.Stanford.EDU>
1987-04-02 20:22 ` ROSENBLUM
1987-04-03 14:49   ` dday
1987-04-06 13:26     ` eric
1987-04-01 23:58 ms8k#
1987-04-03  0:52 ` deller
1987-03-26 17:30 amiram
1987-04-01 15:05 ` joe
1987-04-01 20:12   ` cjh
replies disabled

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