[m-dev.] diff: fix bug in inst_is_mostly_unique

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Feb 22 19:58:17 AEDT 2000


I'll commit this on both the main branch and the 0_9_x branch.

--------------------

Estimated hours taken: 0.75

compiler/inst_match.m:
	Fix a cut-and-paste bug in inst_is_mostly_unique_2:
	one of the occurrences of `bound(mostly_unique, ...)' should
	have been `bound(unique, ...)'.
	
tests/valid/Mmakefile:
tests/valid/mostly_uniq_bug.m:
	Add a regression test for the above-mentioned bug.

Workspace: /d-drive/home/hg/fjh/ws-hg2/mercury
Index: compiler/inst_match.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/inst_match.m,v
retrieving revision 1.43
diff -n -u -d -r1.43 inst_match.m
cvs diff: conflicting specifications of output style
--- compiler/inst_match.m	1998/11/20 04:07:55	1.43
+++ compiler/inst_match.m	2000/02/21 09:24:32
@@ -875,7 +875,7 @@
 :- mode inst_is_mostly_unique_2(in, in, in) is semidet.
 
 inst_is_mostly_unique_2(_, not_reached, _).
-inst_is_mostly_unique_2(ModuleInfo, bound(mostly_unique, List), Expansions) :-
+inst_is_mostly_unique_2(ModuleInfo, bound(unique, List), Expansions) :-
         bound_inst_list_is_mostly_unique_2(List, ModuleInfo, Expansions).
 inst_is_mostly_unique_2(ModuleInfo, bound(mostly_unique, List), Expansions) :-
         bound_inst_list_is_mostly_unique_2(List, ModuleInfo, Expansions).
Index: tests/valid/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/valid/Mmakefile,v
retrieving revision 1.53
diff -n -u -d -r1.53 Mmakefile
cvs diff: conflicting specifications of output style
--- tests/valid/Mmakefile	2000/02/18 07:44:58	1.53
+++ tests/valid/Mmakefile	2000/02/22 08:55:42
@@ -92,6 +92,7 @@
 	module_c.m \
 	module_d.m \
 	module_e.m \
+	mostly_uniq_bug.m \
 	mostly_uniq_neg.m \
 	mostly_uniq_mode_inf.m \
 	multidet_prune1.m \
cvs diff: tests/valid/mostly_uniq_bug.m is a new entry, no comparison available

==============================
tests/valid/mostly_uniq_bug.m:
==============================
% A regression test.
% Mercury 0.9.1 and earlier reported a spurious mode error
% for this code.

:- module mostly_uniq_bug.
:- interface.

:- pred test is det.

:- implementation.

:- type foo ---> f(int).

:- pred p(foo::mostly_unique -> dead) is det.
:- pred q(foo::unique(f(unique(42))) -> dead) is det.

p(_).
q(X) :- p(X).
test :- q(f(42)).

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list