diff: add to BUGS file

Simon Taylor stayl at cs.mu.OZ.AU
Thu Feb 19 15:31:15 AEDT 1998


Estimated hours taken: 0.1

BUGS
	Added an entry for spurious ambiguity errors due to 
	abstract exported equivalence types being made visible
	by --intermodule-optimization.


Index: BUGS
===================================================================
RCS file: /home/staff/zs/imp/mercury/BUGS,v
retrieving revision 1.8
diff -u -r1.8 BUGS
--- BUGS	1997/07/28 08:51:45	1.8
+++ BUGS	1998/02/19 04:27:54
@@ -143,3 +143,30 @@
 	write(f(c)), nl.
 
 -----------------------------------------------------------------------------
+Subject: inter-module optimization and abstract exported equivalence types.
+Date: Thu, 19 February 1998
+
+In some cases the compiler reports spurious ambiguity errors when compiling
+with `--intermodule-optimization'. This is due to the definition of abstract
+exported equivalence types being made visible by inter-module optimization.
+In this example, with `--intermodule-optimization' the compiler sees the
+declaration `:- type var == int' from term.m and then cannot determine whether
+`Elem' has type `int' or `pair(int)'.
+The work-around is to add an explicit type qualification.
+
+:- module foo.
+:- interface.
+:- import_module list, term.
+:- pred test(list(var)::in) is det.
+:- implementation.
+:- import_module int, std_util.
+
+test(Args0) :-
+	MakeIndex =
+		lambda([Elem0::in, Elem::out, Index0::in, Index::out] is det, (
+			Elem = Elem0 - Index0,
+			Index is Index0 + 1
+		)),
+	list__map_foldl(MakeIndex, Args0, _, 0, _).
+
+-----------------------------------------------------------------------------



More information about the developers mailing list