--* From postmaster%watson.vnet.ibm.com@yktvmv.watson.ibm.com  Mon Nov  1 13:06:41 1993
--* Received: from yktvmv.watson.ibm.com by radical.watson.ibm.com (AIX 3.2/UCB 5.64/900524)
--*           id AA11837; Mon, 1 Nov 1993 13:06:41 -0500
--* X-External-Networks: yes
--* Received: from watson.vnet.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 5797; Mon, 01 Nov 93 13:13:51 EST
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.SANTAS.NOTE.YKTVMV.3281.Nov.01.13:13:50.-0500>
--*           for asbugs@watson; Mon, 01 Nov 93 13:13:51 -0500
--* Received: from bernina.ethz.ch by watson.ibm.com (IBM VM SMTP V2R3) with TCP;
--*    Mon, 01 Nov 93 13:13:48 EST
--* Received: from neptune by bernina.ethz.ch with SMTP inbound id <23506-0@bernina.ethz.ch>; Mon, 1 Nov 1993 19:13:41 +0100
--* From: Philip Santas <santas@inf.ethz.ch>
--* Received: from rutishauser.inf.ethz.ch (rutishauser-gw.inf.ethz.ch) by neptune id AA27149; Mon, 1 Nov 93 19:13:31 +0100
--* Date: Mon, 1 Nov 93 19:11:44 +0100
--* Message-Id: <9311011811.AA02353@rutishauser.inf.ethz.ch>
--* Received: from vinci.inf.ethz.ch.rutishauser by rutishauser.inf.ethz.ch id AA02353; Mon, 1 Nov 93 19:11:44 +0100
--* To: asbugs@watson.ibm.com
--* Subject: nested imports of types with the same name
--* Cc: bronstei

--@ Fixed  by:  SSD   Tue Nov 8 09:49:02 EST 1994 
--@ Tested by:  none 
--@ Summary:    The segmentation faults no longer appear. In both programs, the call to goo cannot take an argument z of type T1$P2 and expect to return a value of type T1$<outer>. Both programs correctly report a type error. 


Some more bugs, which have to do with type equality and nesting.
(I have sent a similar example some weeks ago, where tow different
packages define a type with the same name, and they export them:
the result was segmentation faultat run-time. Here I have only
one nested package: the other is global.)

Philip

This program reports segmentation fault at compile time:
-----------------------
C1:Category == with
        constr:SI->%
        destr: %->SI
        goo: (%,%)->%
        y:%

C2:Category == with
        constr:String->%
        destr: %->String
        goo: (%,%)->%
        z:%

T1: C1 == add
         Rep ==> SI
         constr(x:SI):% == per x
         destr(x:%):SI == rep x
         goo(x:%,y:%):%  == per ((rep x)+(rep y))
         y:% == constr 10

foo(x:T1):T1 ==
         P2: with
              T1: C2
           == add
               T1:C2 == add
                   Rep ==> String
                   constr(x:String):% == per x
                   destr(x:%):String == rep x
                   goo(x:%,y:%):%  == y
                   z:% == constr "asd"
         import P2
         import T1
         goo(z$T1$P2,z$T1$P2)$T1$P2

import T1
print(destr foo y)()
-----------------------

The equivalent program
-----------------------
C1:Category == with
        constr:SI->%
        destr: %->SI
        goo: (%,%)->%
        y:%

C2:Category == with
        constr:String->%
        destr: %->String
        goo: (%,%)->%
        z:%

T1: C1 == add
         Rep ==> SI
         constr(x:SI):% == per x
         destr(x:%):SI == rep x
         goo(x:%,y:%):%  == per ((rep x)+(rep y))
         y:% == constr 10

foo(x:T1):T1 ==
         P2: with
              T1: C2
           == add
               T1:C2 == add
                   Rep ==> String
                   constr(x:String):% == per x
                   destr(x:%):String == rep x
                   goo(x:%,y:%):%  == y
                   z:% == constr "asd"
         import P2
         import T1
         goo(x,z)

import T1
print(destr foo y)()
----------------------
cannot find 'z', although T1 has been implicitely imported
(it should ask which T1).

 
