[m-rev.] trivial diff: add missing quotes to an error message

Julien Fischer jfischer at opturion.com
Tue Nov 3 15:52:47 AEDT 2015


Add missing quotes to an error message.

compiler/prog_io_type_defn.m:
     Add quotes around type variables in an error message.

tests/invalid/fundeps_unbound_in_ctor.err_exp:
tests/invalid/type_vars.err_exp:
     Conform to the above change.

Julien.

diff --git a/compiler/prog_io_type_defn.m b/compiler/prog_io_type_defn.m
index 13b7ed8..9f4b5e1 100644
--- a/compiler/prog_io_type_defn.m
+++ b/compiler/prog_io_type_defn.m
@@ -483,13 +483,13 @@ process_du_ctors(Params, VarSet, BodyTerm, [Ctor | Ctors], !Specs) :-
          NotExistQArgTypes = [_ | _]
      then
          varset.coerce(VarSet, GenericVarSet),
-        NotExistQArgTypesStr =
-            mercury_vars_to_name_only(GenericVarSet, NotExistQArgTypes),
+        NotExistQArgTypeStrs = list.map(
+            mercury_var_to_name_only(GenericVarSet), NotExistQArgTypes),
          Pieces = [words("Error:"),
              words(choose_number(NotExistQArgTypes,
-                "type variable", "type variables")),
-            words(NotExistQArgTypesStr),
-            words("in class constraints,"),
+                "type variable", "type variables"))]
+            ++ list_to_quoted_pieces(NotExistQArgTypeStrs) ++
+            [words("in class constraints,"),
              words(choose_number(NotExistQArgTypes,
                  "which was", "which were")),
              words("introduced with"), quote("=>"),
diff --git a/tests/invalid/fundeps_unbound_in_ctor.err_exp b/tests/invalid/fundeps_unbound_in_ctor.err_exp
index 40d2f44..239d4b8 100644
--- a/tests/invalid/fundeps_unbound_in_ctor.err_exp
+++ b/tests/invalid/fundeps_unbound_in_ctor.err_exp
@@ -23,7 +23,7 @@ fundeps_unbound_in_ctor.m:012:   2) The type variable occurs in a type which is
  fundeps_unbound_in_ctor.m:012:   fully determined.
  fundeps_unbound_in_ctor.m:012:   See the "Functional dependencies" section of
  fundeps_unbound_in_ctor.m:012:   the reference manual for details.
-fundeps_unbound_in_ctor.m:018: Error: type variable C in class constraints,
+fundeps_unbound_in_ctor.m:018: Error: type variable `C' in class constraints,
  fundeps_unbound_in_ctor.m:018:   which was introduced with `=>' must be
  fundeps_unbound_in_ctor.m:018:   explicitly existentially quantified using
  fundeps_unbound_in_ctor.m:018:   `some'.
diff --git a/tests/invalid/type_vars.err_exp b/tests/invalid/type_vars.err_exp
index ca2bff5..ac642f1 100644
--- a/tests/invalid/type_vars.err_exp
+++ b/tests/invalid/type_vars.err_exp
@@ -21,6 +21,6 @@ type_vars.m:012: Error: type variable T2 in existential quantifier does not
  type_vars.m:012:   occur in arguments or constraints of constructor.
  type_vars.m:013: Error: type variable `T1' has overlapping scopes (explicit
  type_vars.m:013:   type quantifier shadows argument type).
-type_vars.m:014: Error: type variable T2 in class constraints, which was
+type_vars.m:014: Error: type variable `T2' in class constraints, which was
  type_vars.m:014:   introduced with `=>' must be explicitly existentially
  type_vars.m:014:   quantified using `some'.



More information about the reviews mailing list