bogus duplicate warnings from simplify.m

Fergus Henderson fjh at cs.mu.oz.au
Wed Mar 19 05:40:06 AEDT 1997


Hi Simon,

$ cat bug.m
	:- module bug.
	:- interface.
	:- import_module io.
	:- pred p(io__state::di, io__state::uo) is det.
	:- implementation.
	:- import_module require.
	p --> 
		io__write_string("oops")
		;
		{ error("foo") }.
$ mc -C bug.m
bug.m:009: Warning: this disjunct will never have any solutions.
bug.m:009: Warning: this disjunct will never have any solutions.

The second warning is superfluous and should not be issued.

My guess is that the following patch will fix it, but I would
like you to have a look at the code in simplify.m and
(a) verify that this will fix the bug
(b) make sure that this will not suppress any non-duplicate warnings
and then test it.

I would also like you to add the above example as a test case
(also some additional test cases for the other warnings in simplify.m
might not be a bad idea).

--- simplify.m	Sat Feb 22 20:18:32 1997
+++ simplify.m.new	Wed Mar 19 05:12:36 1997
@@ -94,7 +94,7 @@
 		proc_info_variables(Proc1, VarSet1),
 		proc_info_vartypes(Proc1, VarTypes1),
 		simplify_info_init(DetInfo,
-			simplify(Warn, WarnCalls, Once, no, no, Excess, no),
+			simplify(no, no, Once, no, no, Excess, no),
 			InstMap0, VarSet1, VarTypes1, Info3),
 		simplify_info_set_msgs(Info3, Msgs1, Info4),
 		%proc_info_goal(Proc1, OutGoal),

-- 
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.



More information about the developers mailing list