--* From postmaster%watson.vnet.ibm.com@yktvmv.watson.ibm.com  Fri Aug  5 12:33:13 1994
--* Received: from yktvmv-ob.watson.ibm.com by asharp.watson.ibm.com (AIX 3.2/UCB 5.64/930311)
--*           id AA06733; Fri, 5 Aug 1994 12:33:13 -0400
--* Received: from watson.vnet.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 0557; Fri, 05 Aug 94 12:33:17 EDT
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.LAL.NOTE.YKTVMV.7387.Aug.05.12:33:16.-0400>
--*           for asbugs@watson; Fri, 05 Aug 94 12:33:17 -0400
--* Received: from nag.com by watson.ibm.com (IBM VM SMTP V2R3) with TCP;
--*    Fri, 05 Aug 94 12:33:15 EDT
--* Received: by nag.com (/\==/\ Smail3.1.28.1 #28.1)
--* 	id <m0qWSDe-0001Y0C@nag.com>; Fri, 5 Aug 94 11:34 CDT
--* Message-Id: <m0qWSDe-0001Y0C@nag.com>
--* Date: Fri, 5 Aug 94 11:34 CDT
--* From: lal@nag.com (Larry A. Lambe)
--* To: asbugs@watson.ibm.com, lal@nag.com
--* Subject: [3] has trouble [funbug2.as][36.1 (suncc)]

--@ Fixed  by:  SSD   Tue Aug 9 10:30:29 EDT 1994 
--@ Tested by:  none 
--@ Summary:    Not a bug. 'has' able to find out more at runtime than type inference at compile time. 

--+ I agree that the domain is merely of type BasicType, but my message
--+ did not show the bug that I wanted to report!  Notice that the compiler
--+ DOES claim that the domain exports the list function.  I had this coded
--+ in the example, but the other line blotted it out.  This is really another
--+ report about "has".
--+
--+ fruit% asharp -Fx -lasdem funbug2.as
--+ fruit% funbug2
--+ list(1, 2, 3)
--+ true
--+ true
--+
#include "aslib.as";

macro Int == SingleInteger;
import from Int;
import from List(Int);

ll := list(1,2,3);
print << ll << newline;

AA ==> BasicType -> BasicType;

foo() : with {
  comp : (AA,AA) -> AA;
} == add {
    comp(r:AA,s:AA):AA ==
      {
         loco(bt:BasicType):BasicType == r s bt;
         loco;
      }
}

myList(B:BasicType):BasicType == List(B);
goo ==> (S:BasicType) -> ListCategory S;

myList2(S:BasicType):ListCategory S == List(S);

--G == comp(List pretend AA,List pretend AA)$foo();
G == comp(List,List)$foo();


HH == G(Int);
import from HH;

tst := List(Int) has with {list: Tuple Int -> List(Int)};
print<<tst<<newline;

tst := HH has with {list: Tuple List Int -> HH};
print<<tst<<newline;

--lll:HH := list(list(1,2,3,4)$List(Int),list(8,9)$List(Int))$HH;
 
