--* From SMWATT%WATSON.vnet.ibm.com@yktvmv.watson.ibm.com  Tue Aug 30 11:09:41 1994
--* Received: from yktvmv-ob.watson.ibm.com by asharp.watson.ibm.com (AIX 3.2/UCB 5.64/930311)
--*           id AA20302; Tue, 30 Aug 1994 11:09:41 -0400
--* Received: from watson.vnet.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 7865; Tue, 30 Aug 94 11:09:42 EDT
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.SMWATT.NOTE.VAGENT2.6733.Aug.30.11:08:33.-0400>
--*           for asbugs@watson; Tue, 30 Aug 94 11:08:51 -0400
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id 6589; Tue, 30 Aug 1994 11:08:33 EDT
--* Received: from spadserv.watson.ibm.com by yktvmv.watson.ibm.com
--*    (IBM VM SMTP V2R3) with TCP; Tue, 30 Aug 94 11:07:20 EDT
--* Received: by spadserv.watson.ibm.com (AIX 3.2/UCB 5.64/900524)
--*           id AA35575; Tue, 30 Aug 1994 11:07:35 -0400
--* Date: Tue, 30 Aug 1994 11:07:35 -0400
--* From: smwatt@spadserv.watson.ibm.com (Stephen Watt)
--* X-External-Networks: yes
--* Message-Id: <9408301507.AA35575@spadserv.watson.ibm.com>
--* To: asbugs@watson.ibm.com
--* Subject: [2][tinfer] extends are confused -- give bogus errors

--@ Fixed  by:  SSD   Fri Feb 10 09:59:38 EST 1995 
--@ Tested by:  none 
--@ Summary:    Type inference and runtime fixes for parameterized extensions. 


-- Command line: ashapr monlist.as
-- Version: current
-- Original bug file name: monlist.as

--+ asharp monlist.as
--+ "monlist.as", line 3: extend List(S: BasicType): Monoid == add {
--+                       .....................................^
--+ [L3 C38] #6 (Error) The domain is missing some exports.
--+         Missing =: (%, %) -> Boolean
--+         Missing <<: (TextWriter, %) -> TextWriter
--+         Missing sample: %
--+
--+ "monlist.as", line 4:         1: % == [];
--+                       ................^
--+ [L4 C17] #1 (Error) There are no suitable meanings for the operator `bracket'.
--+
--+ "monlist.as", line 5:         (a: %) * (b: %): % == concat(a, copy b);
--+                       ..............................^.........^
--+ [L5 C31] #2 (Error) There are no suitable meanings for the operator `concat'.
--+ [L5 C41] #3 (Error) There are no suitable meanings for the operator `copy'.
--+
--+ "monlist.as", line 7:                 p := [];
--+                       .....................^
--+ [L7 C22] #4 (Error) There are no suitable meanings for the operator `bracket'.
--+
--+ "monlist.as", line 8:                 for i in 1..n repeat p := concat(a, p);
--+                       ..........................................^
--+ [L8 C43] #5 (Error) There are no suitable meanings for the operator `concat'.
--+
--+ "monlist.as", line 16:         l1 := [1,2,3];
--+                        ........^........^.^
--+ [L16 C9] #7 (Error) No meaning for identifier `l1'.
--+ [L16 C18] #8 (Error) No meaning for integer-style literal `2'.
--+ [L16 C20] #9 (Error) No meaning for integer-style literal `3'.
--+
--+ "monlist.as", line 17:         l2 := [4,5,6];
--+                        ........^
--+ [L17 C9] #10 (Error) No meaning for identifier `l2'.
--+ [L17 C9] #11 (Fatal Error) Too many errors (use `-M emax=n' or `-M no-emax' to c
--+ hange the limit).
#include "aslib"

extend List(S: BasicType): Monoid == add {
        1: % == [];
        (a: %) * (b: %): % == concat(a, copy b);
        (a: %) ^ (n: Integer): % == {
                p := [];
                for i in 1..n repeat p := concat(a, p);
                p
        }
}

f(): () == {
	import from List Integer;

        l1 := [1,2,3];
        l2 := [4,5,6];

        print << l1 * l2 << newline
}
 
