From martin@nagmx1.nag.co.uk  Wed Jun 28 16:09:26 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 QAA15561
	for <ax-bugs@nag.co.uk>; Wed, 28 Jun 2000 16:09:26 +0100 (BST)
From: Martin Dunstan <martin@nag.co.uk>
Date: Wed, 28 Jun 2000 16:04:26 +0100
Message-Id: <200006281504.QAA09440@frisco.nag.co.uk>
Received: by frisco.nag.co.uk (SMI-8.6) id QAA09440; Wed, 28 Jun 2000 16:04:26 +0100
To: ax-bugs@nag.co.uk@nagmx1.nag.co.uk

Subject: fixbug
By: XXX
Fixed: bug1070.as
--* Received: from inf.ethz.ch (neptune.ethz.ch) by nags2.nag.co.uk (4.1/UK-2.1)
--* 	id AA12352; Wed, 24 Apr 96 17:04:31 BST
--* Received: from ru7.inf.ethz.ch (bronstei@ru7.inf.ethz.ch [129.132.12.16]) by inf.ethz.ch (8.6.10/8.6.10) with ESMTP id RAA21752 for <ax-bugs@nag.co.uk>; Wed, 24 Apr 1996 17:59:20 +0200
--* From: Manuel Bronstein <bronstei@inf.ethz.ch>
--* Received: (bronstei@localhost) by ru7.inf.ethz.ch (8.6.8/8.6.6) id RAA13972 for ax-bugs@nag.co.uk; Wed, 24 Apr 1996 17:59:19 +0200
--* Date: Wed, 24 Apr 1996 17:59:19 +0200
--* Message-Id: <199604241559.RAA13972@ru7.inf.ethz.ch>
--* To: ax-bugs
--* Subject: [6] default argument oddity

--@ Bug Number:  bug1070.as 
--@ Fixed  by:  XXX   
--@ Tested by:  /dev/null 
--@ Summary:    seems to work okay now 

-- Command line: none
-- Version: 1.1.6
-- Original bug file name: baddef.as

---------------------- baddef.as ---------------
--
-- This compiles fine if both categories are in the same file.
-- If however we break this into baddef.as and baddef2.as, then
-- we get "Default arguments strike again!"
-- Note that the bug disappears if the line
--	default foo(a:Z, n:Z):Z == a + n;
-- is replaced by
--	default foo(a:Z, n:Z == 0):Z == a + n;
-- but it would be very inconvenient if the default parameter values have
-- to be repeated for each implementation of an exported function. If that
-- is required, why does it work ok in a single file?
--
-- % axiomxl baddef.as
-- % axiomxl -m2 baddef2.as
-- "baddef2.as", line 11:         default bar(m:Z):Z == foo m;
--                        ..................................^
-- [L11 C35] #1 (Error) Argument 1 of `foo' did not match any possible parameter type.
--     The rejected type is SingleInteger.
--     Expected type a: SingleInteger, n: SingleInteger.
--


#include "axllib"

macro Z == SingleInteger;

Foo:Category == with {
	foo: (Z, n:Z == 0) -> Z;
	default foo(a:Z, n:Z):Z == a + n;
};


---------------------- baddef2.as ---------------
#include "axllib"

#library bad "baddef.ao"
import from bad;

macro Z == SingleInteger;

Bar:Category == Foo with {
	bar: Z -> Z;
	default bar(m:Z):Z == foo m;
}


