[m-dev.] For review: unbreak test cases in tests/invalid

Robert Ernst Johann JESCHOFNIK rejj at students.cs.mu.oz.au
Mon Feb 14 17:03:22 AEDT 2000


Estimated hours taken: 1.5

Fix test cases in tests/invalid that were broken due to the recent move
towards using error_util.m for error messages.
Also fix up the production of error messages in typecheck.m. Unwanted " ,"'s
and " and"'s were being produced by error_util__list_to_pieces.

mercury/compiler/typecheck.m:
	Correct the production of the error messages for missing clauses.

tests/invalid/aditi_update_errors.err_exp:
tests/invalid/missing_det_decls.err_exp:
tests/invalid/pragma_c_code_dup_var.err_exp:
tests/invalid/prog_io_erroneous.err_exp:
tests/invalid/prog_io_erroneous.err_exp2:
tests/invalid/record_syntax_errors.err_exp:
	Update the test cases that report an error for missing clauses. These
	were broken by the recent change in typecheck.m that began moving
	towards using error_util.m's functionality for producing error
	messages.


Index: typecheck.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/typecheck.m,v
retrieving revision 1.271
diff -u -r1.271 typecheck.m
--- typecheck.m	2000/02/10 07:12:01	1.271
+++ typecheck.m	2000/02/14 05:49:39
@@ -4500,9 +4500,9 @@
 
 report_error_no_clauses(PredId, PredInfo, ModuleInfo) -->
 	{ pred_info_context(PredInfo, Context) },
-	{ error_util__describe_one_pred_name(ModuleInfo, PredId, PredName) },
-	{ ErrorMsg0 = [ "Error: no clauses for ", PredName, "." ] },
-	{ error_util__list_to_pieces(ErrorMsg0, ErrorMsg) },
+	{ error_util__describe_one_pred_name(ModuleInfo, PredId, PredName0) },
+	{ string__append(PredName0, ".", PredName) },
+	{ ErrorMsg = [ words("Error: no clauses for "), fixed(PredName) ] },
 	error_util__write_error_pieces(Context, 0, ErrorMsg).
 
 %-----------------------------------------------------------------------------%

Index: tests/invalid/aditi_update_errors.err_exp
===================================================================
RCS file: /home/mercury1/repository//tests/invalid/aditi_update_errors.err_exp,v
retrieving revision 1.2
diff -u -r1.2 aditi_update_errors.err_exp
--- tests/invalid/aditi_update_errors.err_exp	1999/11/09 22:40:12	1.2
+++ tests/invalid/aditi_update_errors.err_exp	2000/02/14 02:46:51
@@ -40,7 +40,8 @@
 aditi_update_errors.m:073:   warning: variable `X' has overlapping scopes.
 aditi_update_errors.m:083: In clause for predicate `aditi_update_errors:aditi_update_syntax/2':
 aditi_update_errors.m:083:   warning: variable `X' has overlapping scopes.
-aditi_update_errors.m:007: Error: no clauses for predicate `aditi_update_errors:aditi_update_syntax/2'.
+aditi_update_errors.m:007: Error: no clauses for
+aditi_update_errors.m:007:   predicate `aditi_update_errors:aditi_update_syntax/2'.
 aditi_update_errors.m:097: In clause for predicate `aditi_update_errors:aditi_update_types/2':
 aditi_update_errors.m:097:   error: wrong number of arguments (2; should be 3)
 aditi_update_errors.m:097:   in call to predicate `p'.
@@ -146,7 +147,8 @@
 aditi_update_errors.m:175:   in argument 2 of `aditi_modify' of function `q/2':
 aditi_update_errors.m:175:   type error: variable `ModifyQ' has type `((aditi_top_down func(V_47, int, int, V_50, int)) = int)',
 aditi_update_errors.m:175:   expected type was `(aditi_top_down pred((aditi:state), int, int, (aditi:state), int, int))'.
-aditi_update_errors.m:026: Error: no clauses for predicate `aditi_update_errors:anc/3'.
+aditi_update_errors.m:026: Error: no clauses for
+aditi_update_errors.m:026:   predicate `aditi_update_errors:anc/3'.
 aditi_update_errors.m:094: In `aditi_insert' of predicate `anc/3':
 aditi_update_errors.m:094:   error: the modified predicate is not a base relation.
 For more information, try recompiling with `-E'.
Index: tests/invalid/missing_det_decls.err_exp
===================================================================
RCS file: /home/mercury1/repository//tests/invalid/missing_det_decls.err_exp,v
retrieving revision 1.4
diff -u -r1.4 missing_det_decls.err_exp
--- tests/invalid/missing_det_decls.err_exp	1999/11/09 22:40:13	1.4
+++ tests/invalid/missing_det_decls.err_exp	2000/02/14 05:19:53
@@ -6,8 +6,12 @@
 missing_det_decls.m:013:   predicate `missing_det_decls:loc1/0'.
 missing_det_decls.m:016: Error: no determinism declaration for local
 missing_det_decls.m:016:   predicate `missing_det_decls:loc2/1'.
-missing_det_decls.m:004: Error: no clauses for predicate `missing_det_decls:exp1/0'.
-missing_det_decls.m:007: Error: no clauses for predicate `missing_det_decls:exp2/1'.
-missing_det_decls.m:012: Error: no clauses for predicate `missing_det_decls:loc1/0'.
-missing_det_decls.m:015: Error: no clauses for predicate `missing_det_decls:loc2/1'.
+missing_det_decls.m:004: Error: no clauses for
+missing_det_decls.m:004:   predicate `missing_det_decls:exp1/0'.
+missing_det_decls.m:007: Error: no clauses for
+missing_det_decls.m:007:   predicate `missing_det_decls:exp2/1'.
+missing_det_decls.m:012: Error: no clauses for
+missing_det_decls.m:012:   predicate `missing_det_decls:loc1/0'.
+missing_det_decls.m:015: Error: no clauses for
+missing_det_decls.m:015:   predicate `missing_det_decls:loc2/1'.
 For more information, try recompiling with `-E'.
Index: tests/invalid/pragma_c_code_dup_var.err_exp
===================================================================
RCS file: /home/mercury1/repository//tests/invalid/pragma_c_code_dup_var.err_exp,v
retrieving revision 1.1
diff -u -r1.1 pragma_c_code_dup_var.err_exp
--- tests/invalid/pragma_c_code_dup_var.err_exp	1999/12/10 02:18:10	1.1
+++ tests/invalid/pragma_c_code_dup_var.err_exp	2000/02/14 05:20:48
@@ -1,5 +1,6 @@
 pragma_c_code_dup_var.m:019: In `:- pragma c_code' declaration for function `pragma_c_code_dup_var:bread_impl/6':
 pragma_c_code_dup_var.m:019:   error: variable `Buf' occurs multiple times
 pragma_c_code_dup_var.m:019:   in the argument list.
-pragma_c_code_dup_var.m:014: Error: no clauses for function `pragma_c_code_dup_var:bread_impl/7'.
+pragma_c_code_dup_var.m:014: Error: no clauses for
+pragma_c_code_dup_var.m:014:   function `pragma_c_code_dup_var:bread_impl/7'.
 For more information, try recompiling with `-E'.
Index: tests/invalid/prog_io_erroneous.err_exp
===================================================================
RCS file: /home/mercury1/repository//tests/invalid/prog_io_erroneous.err_exp,v
retrieving revision 1.5
diff -u -r1.5 prog_io_erroneous.err_exp
--- tests/invalid/prog_io_erroneous.err_exp	1999/11/09 22:40:13	1.5
+++ tests/invalid/prog_io_erroneous.err_exp	2000/02/14 05:22:51
@@ -1,5 +1,6 @@
 prog_io_erroneous.m:  1: Warning: interface for module `prog_io_erroneous' does not export anything.
-prog_io_erroneous.m:012: Error: no clauses for predicate `prog_io_erroneous:q/2'.
+prog_io_erroneous.m:012: Error: no clauses for
+prog_io_erroneous.m:012:   predicate `prog_io_erroneous:q/2'.
 prog_io_erroneous.m:007: In clause for `p(in, out, out)':
 prog_io_erroneous.m:007:   in argument 1 of call to predicate `prog_io_erroneous:q/2':
 prog_io_erroneous.m:007:   mode error: variable `Y' has instantiatedness `free',
Index: tests/invalid/prog_io_erroneous.err_exp2
===================================================================
RCS file: /home/mercury1/repository//tests/invalid/prog_io_erroneous.err_exp2,v
retrieving revision 1.3
diff -u -r1.3 prog_io_erroneous.err_exp2
--- tests/invalid/prog_io_erroneous.err_exp2	1999/11/09 22:40:15	1.3
+++ tests/invalid/prog_io_erroneous.err_exp2	2000/02/14 05:24:30
@@ -1,3 +1,4 @@
 prog_io_erroneous.m:  1: Warning: interface for module `prog_io_erroneous' does not export anything.
-prog_io_erroneous.m:012: Error: no clauses for predicate `prog_io_erroneous:q/2'.
+prog_io_erroneous.m:012: Error: no clauses for
+prog_io_erroneous.m:012:   predicate `prog_io_erroneous:q/2'.
 For more information, try recompiling with `-E'.
Index: tests/invalid/record_syntax_errors.err_exp
===================================================================
RCS file: /home/mercury1/repository//tests/invalid/record_syntax_errors.err_exp,v
retrieving revision 1.2
diff -u -r1.2 record_syntax_errors.err_exp
--- tests/invalid/record_syntax_errors.err_exp	2000/01/25 04:10:29	1.2
+++ tests/invalid/record_syntax_errors.err_exp	2000/02/14 05:30:05
@@ -17,8 +17,10 @@
 record_syntax_errors.m:057:   function, for example to check the input to a
 record_syntax_errors.m:057:   field update, give the field of the constructor a
 record_syntax_errors.m:057:   different name.
-record_syntax_errors.m:014: Error: no clauses for predicate `record_syntax_errors:dcg_syntax/2'.
-record_syntax_errors.m:016: Error: no clauses for predicate `record_syntax_errors:dcg_syntax_2/2'.
+record_syntax_errors.m:014: Error: no clauses for
+record_syntax_errors.m:014:   predicate `record_syntax_errors:dcg_syntax/2'.
+record_syntax_errors.m:016: Error: no clauses for
+record_syntax_errors.m:016:   predicate `record_syntax_errors:dcg_syntax_2/2'.
 record_syntax_errors.m:042: In clause for predicate `record_syntax_errors:construct_exist_cons/1':
 record_syntax_errors.m:042:   error: invalid field update `field2:=/2':
 record_syntax_errors.m:005:   existentially quantified type variable `T' occurs


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