--* From postmaster%watson.vnet.ibm.com@yktvmv.watson.ibm.com  Mon Aug  8 08:17:44 1994
--* Received: from yktvmv-ob.watson.ibm.com by asharp.watson.ibm.com (AIX 3.2/UCB 5.64/930311)
--*           id AA20656; Mon, 8 Aug 1994 08:17:44 -0400
--* Received: from watson.vnet.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 8943; Mon, 08 Aug 94 08:17:48 EDT
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.BRONSTEI.NOTE.YKTVMV.5361.Aug.08.08:17:48.-0400>
--*           for asbugs@watson; Mon, 08 Aug 94 08:17:48 -0400
--* Received: from inf.ethz.ch by watson.ibm.com (IBM VM SMTP V2R3) with TCP;
--*    Mon, 08 Aug 94 08:17:47 EDT
--* Received: from ru7.inf.ethz.ch (ru7.inf.ethz.ch [129.132.12.16]) by inf.ethz.ch (8.6.9/8.6.9) with ESMTP id OAA20869 for <asbugs@watson.ibm.com>; Mon, 8 Aug 1994 14:17:42 +0200
--* From: Manuel Bronstein <bronstei@inf.ethz.ch>
--* Received: (bronstei@localhost) by ru7.inf.ethz.ch (8.6.8/8.6.6) id OAA07439 for asbugs@watson.ibm.com; Mon, 8 Aug 1994 14:17:41 +0200
--* Date: Mon, 8 Aug 1994 14:17:41 +0200
--* Message-Id: <199408081217.OAA07439@ru7.inf.ethz.ch>
--* To: asbugs@watson.ibm.com
--* Subject: [3] parameter checking in types causes seg fault [bug.as][0.36.0]

--@ Fixed  by:  SSD   Tue Aug 9 22:43:38 EDT 1994 
--@ Tested by:  none 
--@ Summary:    Several bugs in type checking and error messages on domain producing sequences. 

----------------------------- bug.as ----------------------------------
--
-- The parameter check in this function (before the add) causes
-- a compile time seg fault:
--
-- ru7.inf.ethz.ch{bronstei} 99: asharp bug.as
-- #1 (Error) Program fault (segmentation violation).
--

#include "aslib.as"

macro Z == SingleInteger;

Foo(p:Z): BasicType with {
        foo: % -> Z;
	bar: (%, %) -> Z;
} == {
	-- This type compiles ok if the following line is commented out
	p < 2 => error "Foo: p should be at least 2";

	Z add {
		macro Rep == Z;
		import from Rep;

		foo(a:%):Z	== rep a;
		bar(a:%, b:%):Z	== mod_/(foo a, foo b, p);
	}
}
 
