error message/inference bug?

Fergus Henderson fjh at cs.mu.oz.au
Sun Sep 28 05:44:06 AEST 1997


Tomas By wrote:
> The error message below seems incorrect. According to the (mode) 
> declaration
> the procedure (test/1) should cover 'b' and 'c', but it does cover 'a' and 
> 'b'.
> ----- switch.err -------------------------------
> switch.m:020: In `test(in(switch:y))':
> switch.m:020:   error: determinism declaration not satisfied.
> switch.m:020:   Declared `det', inferred `semidet'.
> switch.m:022:   The switch on HeadVar__1 does not cover switch:a/1, 
> switch:c/1 and switch:d/1.
> For more information, try recompiling with `-E'.

You're right.  Here's the fix... though I'm not sure if you'll like it!
A nicer fix is possible, but would require a fair bit of work.

Index: det_report.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/det_report.m,v
retrieving revision 1.40
diff -u -u -r1.40 det_report.m
--- det_report.m	1997/09/01 14:01:15	1.40
+++ det_report.m	1997/09/27 19:38:12
@@ -676,7 +676,7 @@
 	( { First = yes } ->
 		[]
 	; { ConsIds = [] } ->
-		io__write_string(" and ")
+		io__write_string(" and/or ")
 	;
 		io__write_string(", ")
 	),

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