[m-rev.] diff: improve type declaration error messages

Simon Taylor stayl at cs.mu.OZ.AU
Fri Jan 11 16:42:41 AEDT 2002


Estimated hours taken: 0.25
Branches: main

compiler/make_hlds.m:
	Don't refer to undiscriminated union types in error
	messages for type declarations like `:- type t = int.'.
	It just confuses users.

tests/invalid/big_test.err_exp:
tests/invalid/uu_type.err_exp:
	Update expected error messages.

Index: compiler/make_hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make_hlds.m,v
retrieving revision 1.395
diff -u -u -r1.395 make_hlds.m
--- compiler/make_hlds.m	7 Jan 2002 15:14:42 -0000	1.395
+++ compiler/make_hlds.m	11 Jan 2002 05:37:06 -0000
@@ -1948,11 +1948,10 @@
 			io__stderr_stream(StdErr),
 			io__set_output_stream(StdErr, OldStream),
 			prog_out__write_context(Context),
-			io__write_string(
-	"Sorry, not implemented: undiscriminated union type.\n"),
+			io__write_string("Error in type declaration: \n"),
 			prog_out__write_context(Context),
 			io__write_string(
-	"(The syntax for type equivalence is `:- type t1 == t2'.)\n"),
+	"  the syntax for type equivalence is `:- type t1 == t2'.\n"),
 			io__set_exit_status(1),
 			io__set_output_stream(OldStream, _)
 		;
Index: tests/invalid/bigtest.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/bigtest.err_exp,v
retrieving revision 1.5
diff -u -u -r1.5 bigtest.err_exp
--- tests/invalid/bigtest.err_exp	21 Sep 1999 07:23:56 -0000	1.5
+++ tests/invalid/bigtest.err_exp	11 Jan 2002 05:38:38 -0000
@@ -5,8 +5,8 @@
 bigtest.m:001: Warning: declaration not yet implemented.
 bigtest.m:002: Warning: declaration not yet implemented.
 bigtest.m:003: Warning: declaration not yet implemented.
-bigtest.m:016: Sorry, not implemented: undiscriminated union type.
-bigtest.m:016: (The syntax for type equivalence is `:- type t1 == t2'.)
+bigtest.m:016: Error in type declaration: 
+bigtest.m:016:   the syntax for type equivalence is `:- type t1 == t2'.
 bigtest.m:005: Error: clause for predicate `bigtest:fact/0'
 bigtest.m:005:   without preceding `pred' declaration.
 bigtest.m:005: Inferred :- pred fact.
Index: tests/invalid/uu_type.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/uu_type.err_exp,v
retrieving revision 1.1
diff -u -u -r1.1 uu_type.err_exp
--- tests/invalid/uu_type.err_exp	28 Oct 1998 09:49:26 -0000	1.1
+++ tests/invalid/uu_type.err_exp	11 Jan 2002 05:38:50 -0000
@@ -1,3 +1,3 @@
-uu_type.m:022: Sorry, not implemented: undiscriminated union type.
-uu_type.m:022: (The syntax for type equivalence is `:- type t1 == t2'.)
+uu_type.m:022: Error in type declaration: 
+uu_type.m:022:   the syntax for type equivalence is `:- type t1 == t2'.
 For more information, try recompiling with `-E'.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list