[m-rev.] diff: fix a badly formatted verbose warning message

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Jan 6 17:22:43 AEDT 2012


Branches: main, 11.07

Fix a problem wth some error message formatting reported by Michael Hendricks.

compiler/typecheck_errors.m:
 	Use error_util to format the verbose type ambiguity warning message.

Julien.

Index: compiler/typecheck_errors.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/typecheck_errors.m,v
retrieving revision 1.53
diff -u -r1.53 typecheck_errors.m
--- compiler/typecheck_errors.m	22 Aug 2011 04:23:14 -0000	1.53
+++ compiler/typecheck_errors.m	6 Jan 2012 05:18:59 -0000
@@ -1314,7 +1314,7 @@
          AmbiguityPieces = [_ | _],
          Pieces2 = [words("Possible type assignments include:"), nl
              | AmbiguityPieces],
-        VerboseComponents = [verbose_only([words(add_qualifiers_reminder)])],
+        VerboseComponents = [verbose_only(add_qualifiers_reminder)],
          WarningMsgs = []
      ),

@@ -1324,15 +1324,17 @@
      Spec = error_spec(severity_error, phase_type_check,
          [MainMsg | WarningMsgs]).

-:- func add_qualifiers_reminder = string.
+:- func add_qualifiers_reminder = list(format_component).

-add_qualifiers_reminder =
-    "You will need to add an explicit type qualification" ++
-    "to resolve the type ambiguity." ++
-    "The way to add an explicit type qualification is to use ""with_type""." ++
-    "For details see the ""Explicit type qualification"" sub-section" ++
-    "of the ""Data-terms"" section of the ""Syntax"" chapter" ++
-    "of the Mercury language reference manual.".
+add_qualifiers_reminder = [
+    words("You will need to add an explicit type qualification"),
+    words("to resolve the type ambiguity."),
+    words("The way to add an explicit type qualification"),
+    words("is to use \"with_type\"."),
+    words("For details see the"),  fixed("\"Explicit type qualification\""),
+    words(" sub-section of the \"Data-terms\" section of the"),
+    words("\"Syntax\" chapter of the Mercury language reference manual.")
+].

  :- func ambiguity_error_possibilities_to_pieces(list(prog_var), prog_varset,
      type_assign, type_assign) = list(format_component).

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list