From martin@nagmx1.nag.co.uk  Wed Jun 28 15:46:33 2000
Received: from frisco.nag.co.uk (frisco.nag.co.uk [192.156.217.22])
	by nagmx1.nag.co.uk (8.9.3/8.9.3) with SMTP id PAA14909
	for <ax-bugs@nag.co.uk>; Wed, 28 Jun 2000 15:46:32 +0100 (BST)
From: Martin Dunstan <martin@nag.co.uk>
Date: Wed, 28 Jun 2000 15:41:33 +0100
Message-Id: <200006281441.PAA09299@frisco.nag.co.uk>
Received: by frisco.nag.co.uk (SMI-8.6) id PAA09299; Wed, 28 Jun 2000 15:41:33 +0100
To: ax-bugs@nag.co.uk@nagmx1.nag.co.uk

Subject: fixbug
By: XXX
Fixed: bug1137.as
--* From youssef@mailer.scri.fsu.edu  Fri Jan 23 02:51:02 1998
--* Received: from nagmx1.nag.co.uk by red.nag.co.uk via SMTP (920330.SGI/920502.SGI)
--* 	for /home/red5/axiom/support/recvbug id AA12794; Fri, 23 Jan 98 02:51:02 GMT
--* Received: from mailer.scri.fsu.edu (mailer.scri.fsu.edu [144.174.112.142])
--*           by nagmx1.nag.co.uk (8.8.4/8.8.4) with ESMTP
--* 	  id CAA02032 for <ax-bugs@nag.co.uk>; Fri, 23 Jan 1998 02:53:20 GMT
--* Received: from sp2-8.scri.fsu.edu (sp2-8.scri.fsu.edu [144.174.128.98]) by mailer.scri.fsu.edu (8.8.7/8.7.5) with SMTP id VAA03921; Thu, 22 Jan 1998 21:50:46 -0500 (EST)
--* From: Saul Youssef <youssef@scri.fsu.edu>
--* Received: by sp2-8.scri.fsu.edu (5.67b) id AA21279; Thu, 22 Jan 1998 21:50:45 -0500
--* Date: Thu, 22 Jan 1998 21:50:45 -0500
--* Message-Id: <199801230250.AA21279@sp2-8.scri.fsu.edu>
--* To: adk@mailer.scri.fsu.edu, ax-bugs@nag.co.uk, edwards@mailer.scri.fsu.edu,
--*         youssef@mailer.scri.fsu.edu
--* Subject: [5] Union funny business

--@ Bug Number:  bug1137.as 
--@ Fixed  by:  XXX   
--@ Tested by:  union0.as 
--@ Summary:    no fix 

-- Command line: axiomxl -g interp -Fx file.as
-- Version: 1.1.10c
-- Original bug file name: bug0.as

--+ --
--+ -- Peter:
--+ --
--+ --    I don't think that the results I get with this program are
--+ --  correct.  I would have expected the compiler to complain that
--+ --  = is not defined for unions, but it seems to produce results
--+ --  anyway.
--+ --
--+ --     Regards,
--+ --       Saul Youssef
--+ --
--+ #include "axllib"
--+ #pile
--+ 
--+ SI ==> SingleInteger
--+ 
--+ import from SI
--+ 
--+ U == Union(foointeger:SI, barinteger:SI)
--+ 
--+ foo42:U := [foointeger == 42]
--+ bar42:U := [barinteger == 42]
--+ foo42also:U := [foointeger == 42]
--+ 
--+ if foo42=bar42 then print << "foo42=bar42" << newline
--+ else
--+    print << "foo42 ~= bar42" << newline
--+  
--+ if foo42=foo42also then print << "foo42=foo42also" << newline
--+ else
--+    print << "foo42 ~=foo42_also" << newline
--
-- Peter:
--
--    I don't think that the results I get with this program are
--  correct.  I would have expected the compiler to complain that
--  = is not defined for unions, but it seems to produce results
--  anyway.
--
--     Regards,
--       Saul Youssef
--
#include "axllib"
#pile

SI ==> SingleInteger

import from SI

U == Union(foointeger:SI, barinteger:SI)

foo42:U := [foointeger == 42]
bar42:U := [barinteger == 42]
foo42also:U := [foointeger == 42]

if foo42=bar42 then print << "foo42=bar42" << newline
else
   print << "foo42 ~= bar42" << newline
 
if foo42=foo42also then print << "foo42=foo42also" << newline
else
   print << "foo42 ~=foo42_also" << newline

--+ Union is extended in Axllib to satisfy BasicType. However, the equality
--+ test simply checks to see if the two arguments refer to the same object
--+ in memory rather than checking to see that they have the same value.
--+ 
--+ Hence this program is actually behaving correctly.
