[m-dev.] trivial diff: fix typo in error message

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Feb 28 23:13:23 AEDT 2001


Estimated hours taken: 0.25

compiler/mode_errors.m:
	Fix a missing newline in an error message.

tests/invalid/Mmakefile:
tests/invalid/mode_inf.m:
tests/invalid/mode_inf.err_exp:
	Add a test case to test that error message.

Workspace: /mnt/venus/home/venus/fjh/ws-venus2/mercury
Index: compiler/mode_errors.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mode_errors.m,v
retrieving revision 1.69
diff -u -d -r1.69 mode_errors.m
--- compiler/mode_errors.m	2001/02/08 11:37:46	1.69
+++ compiler/mode_errors.m	2001/02/28 11:34:14
@@ -524,7 +524,7 @@
 	output_inst_list(Insts, InstVarSet),
 	io__write_string("',\n"),
 	prog_out__write_context(Context),
-	io__write_string("  which does not match any of the valid modes for "),
+	io__write_string("  which does not match any of the valid modes for\n"),
 	globals__io_lookup_bool_option(verbose_errors, VerboseErrors),
 	( { VerboseErrors = yes } ->
 		prog_out__write_context(Context),
Index: tests/invalid/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/Mmakefile,v
retrieving revision 1.79
diff -u -d -r1.79 Mmakefile
--- tests/invalid/Mmakefile	2001/02/08 12:57:40	1.79
+++ tests/invalid/Mmakefile	2001/02/28 12:09:42
@@ -52,6 +52,7 @@
 	method_impl.m \
 	missing_det_decls.m \
 	missing_interface_import.m \
+	mode_inf.m \
 	modes_erroneous.m \
 	mostly_uniq1.m \
 	mostly_uniq2.m \
@@ -124,6 +125,7 @@
 MCFLAGS-missing_det_decls =	--no-infer-det
 MCFLAGS-missing_interface_import = --make-interface
 MCFLAGS-multisoln_func	=	--infer-types
+MCFLAGS-mode_inf	=	--infer-all
 MCFLAGS-no_exports = 		--halt-at-warn
 MCFLAGS-sub_c = 		--verbose-error-messages
 MCFLAGS-record_syntax_errors =	--verbose-error-messages
Index: tests/invalid/mode_inf.err_exp
===================================================================
RCS file: mode_inf.err_exp
diff -N mode_inf.err_exp
--- /dev/null	Thu Mar 30 14:06:13 2000
+++ mode_inf.err_exp	Wed Feb 28 23:09:00 2001
@@ -0,0 +1,12 @@
+mode_inf.m:009: In clause for `p(out, out)':
+mode_inf.m:009:   in call to predicate `mode_inf:q/2':
+mode_inf.m:009:   mode error: arguments `X, Y'
+mode_inf.m:009:   have insts `free, free',
+mode_inf.m:009:   which does not match any of the valid modes for
+mode_inf.m:009:   the callee, because of the following error.
+mode_inf.m:011: In clause for `q(out(not_reached), out(not_reached))':
+mode_inf.m:011:   in argument 1 of clause head:
+mode_inf.m:011:   mode error in unification of `HeadVar__1' and `X'.
+mode_inf.m:011:   Variable `HeadVar__1' has instantiatedness `free',
+mode_inf.m:011:   variable `X' has instantiatedness `free'.
+For more information, try recompiling with `-E'.
Index: tests/invalid/mode_inf.m
===================================================================
RCS file: mode_inf.m
diff -N mode_inf.m
--- /dev/null	Thu Mar 30 14:06:13 2000
+++ mode_inf.m	Wed Feb 28 23:08:09 2001
@@ -0,0 +1,13 @@
+:- module mode_inf.
+:- interface.
+
+:- pred p(int, int).
+:- mode p(out, out) is det.
+
+:- implementation.
+
+p(X, Y) :- q(X, Y).
+
+:- pred q(int, int).
+q(X, X).
+

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- 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