--* From SMWATT%WATSON.vnet.ibm.com@yktvmh.watson.ibm.com  Thu Oct  7 11:12:49 1993
--* Received: from yktvmh.watson.ibm.com by radical.watson.ibm.com (AIX 3.2/UCB 5.64/900524)
--*           id AA47653; Thu, 7 Oct 1993 11:12:49 -0400
--* Received: from watson.vnet.ibm.com by yktvmh.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 6716; Thu, 07 Oct 93 11:18:43 EDT
--* Received: from YKTVMH by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.SMWATT.NOTE.VAGENT2.2593.Oct.07.11:18:42.-0400>
--*           for asbugs@watson; Thu, 07 Oct 93 11:18:43 -0400
--* Received: from YKTVMH by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id 2591; Thu, 7 Oct 1993 11:18:42 EDT
--* Received: from cyst.watson.ibm.com by yktvmh.watson.ibm.com (IBM VM SMTP V2R3)
--*    with TCP; Thu, 07 Oct 93 11:18:42 EDT
--* Received: from spadserv.watson.ibm.com by cyst.watson.ibm.com (AIX 3.2/UCB 5.64/900528)
--*   id AA55836; Thu, 7 Oct 1993 11:18:04 -0400
--* Received: by spadserv.watson.ibm.com (AIX 3.2/UCB 5.64/900524)
--*           id AA21631; Thu, 7 Oct 1993 11:24:47 -0400
--* Date: Thu, 7 Oct 1993 11:24:47 -0400
--* From: smwatt@spadserv.watson.ibm.com (Stephen Watt)
--* X-External-Networks: yes
--* Message-Id: <9310071524.AA21631@spadserv.watson.ibm.com>
--* To: asbugs@watson.ibm.com
--* Subject: Simplified version of bug130 [ss.as][v31.0]

--@ Fixed  by:  SSD   Thu Jun 2 09:53:21 EDT 1994 
--@ Tested by:  none 
--@ Summary:    Modifications to scobind have removed the error message. We now know that x is an Integer in the outer scope. 


--+ Should be able to infer type for x.  Actually it does know x is an integer
--+ there but is not saying so.
--+
#include "aslib.as"

f(): Integer ==
      y:Integer:= 2
      y < 0 => 2
      z:Integer := 1
      while z > 0 repeat
--        x:Integer := y      -- (1)
        x := y		      -- (2)
        xn:= x^2	      -- (3) syme(x) is the same that in (2)
        y := (3*x*xn+1) quo 3
        z := x-y
      x			      -- (4) syme(x) is DIFFERENT that in (2)

----------------------------------------------------------------
-- Analized by PI 10/11/93
-- I think that the bug is in scobind
-- The problem is that when there is an implicit declaration for an identifier
-- within the body of a loop, the syme for this identifier outside of the
-- loop scope is different. The syme is the same if the declaration is
-- explicit.
-- Scobind.c should be modified so that everytime an identifier 'x' appears for
-- the first time as lhs of an assignment, then it should have the same
-- semantic of:
--          x: (Unknown) := ...rhs...
 
