[m-rev.] for review: typecheck error message simplification

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Jul 23 15:09:00 AEST 2001


For review by anyone.

compiler/typecheck.m:
	Avoid the output of error messages of the form

	"variable X has overloaded type { T, T, T, T}"

	Instead, simply report that X has type T.

Zoltan.

Index: typecheck.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/typecheck.m,v
retrieving revision 1.306
diff -u -b -r1.306 typecheck.m
--- typecheck.m	2001/07/20 14:14:25	1.306
+++ typecheck.m	2001/07/23 05:07:53
@@ -5037,8 +5037,11 @@
 
 write_type_of_var(_TypeCheckInfo, TypeAssignSet, Var) -->
 	{ get_type_stuff(TypeAssignSet, Var, TypeStuffList) },
-	( { TypeStuffList = [SingleTypeStuff] } ->
-		{ SingleTypeStuff = type_stuff(VType, TVarSet, TBinding) },
+	(
+		{ TypeStuffList = [ExampleTypeStuff | _] },
+		{ list__all_same(TypeStuffList) }
+	->
+		{ ExampleTypeStuff = type_stuff(VType, TVarSet, TBinding) },
 		io__write_string(" has type `"),
 		write_type_b(VType, TVarSet, TBinding),
 		io__write_string("'")
--------------------------------------------------------------------------
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