[m-rev.] for review: verbose errors prompt

Julien Fischer juliensf at cs.mu.OZ.AU
Wed Sep 14 13:17:06 AEST 2005


For review by anyone.

Estimated hours taken: 1.5
Branches: main

Do not display the `For more information try recompiling with `-E'' prompt
unless we really mean it, i.e there is actually more information
available.

XXX This change is incomplete for the mode_errors module because that
module requires more substantial changes to make this work - I'll do
that as a separate diff.

compiler/globals.m
	Add a new global (and access predicates) that keeps track of whether
	we have any verbose error information that could be displayed if we
	recompiled with `-E'.

compiler/mercury_compile.m
	Check the new global flag before prompting the user to recompile with
	`-E'.

compiler/mode_errors.m
	Add an XXX comment about needing to respect the extra error info flag
	properly.

compiler/accumulator.m
compiler/add_clause.m
compiler/add_pred.m
compiler/add_type.m
compiler/assertion.m
compiler/check_typeclass.m
compiler/det_report.m
compiler/magic_util.m
compiler/make_hlds_error.m
compiler/modes.m
compiler/module_qual.m
compiler/modules.m
compiler/post_typecheck.m
compiler/purity.m
compiler/stratify.m
compiler/typecheck_errors.m
	Set the new global flag when we come across an error
	for which we have a verbose error message.

tests/recompilation/*:
tests/invalid/*:
	Update expected error files.

(The following diff lists only the changes to the compiler directory -
the changes to the tests directory, in addition to being rather long
and boring, are all trivial.)

Index: accumulator.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/accumulator.m,v
retrieving revision 1.41
diff -u -r1.41 accumulator.m
--- accumulator.m	13 Sep 2005 04:55:57 -0000	1.41
+++ accumulator.m	13 Sep 2005 06:55:07 -0000
@@ -285,7 +285,8 @@
                     words("the warnings.")],
                 write_error_pieces(Context, 2, Pieces2, !IO)
             ;
-                VerboseErrors = no
+                VerboseErrors = no,
+                globals__io_set_extra_error_info(yes, !IO)
             ),
             globals__io_lookup_bool_option(halt_at_warn, HaltAtWarn, !IO),
             (
Index: add_clause.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/add_clause.m,v
retrieving revision 1.7
diff -u -r1.7 add_clause.m
--- add_clause.m	13 Sep 2005 04:55:57 -0000	1.7
+++ add_clause.m	13 Sep 2005 06:56:42 -0000
@@ -206,6 +206,7 @@
                 list__append(ErrorPieces0, ErrorPieces1, ErrorPieces)
             ;
                 Verbose = no,
+                globals__io_set_extra_error_info(yes, !IO),
                 ErrorPieces = ErrorPieces0
             ),
             error_util__write_error_pieces(Context, 0, ErrorPieces, !IO)
Index: add_pred.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/add_pred.m,v
retrieving revision 1.4
diff -u -r1.4 add_pred.m
--- add_pred.m	12 Sep 2005 08:41:55 -0000	1.4
+++ add_pred.m	13 Sep 2005 06:57:31 -0000
@@ -460,7 +460,8 @@
             words("of local predicates.)")],
         write_error_pieces(Context, 0, VerbosePieces, !IO)
     ;
-        VerboseErrors = no
+        VerboseErrors = no,
+        globals.io_set_extra_error_info(yes, !IO)
     ).

 :- pred unspecified_det_for_method(sym_name::in, arity::in, pred_or_func::in,
Index: add_type.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/add_type.m,v
retrieving revision 1.3
diff -u -r1.3 add_type.m
--- add_type.m	12 Sep 2005 05:24:02 -0000	1.3
+++ add_type.m	13 Sep 2005 06:58:21 -0000
@@ -252,7 +252,8 @@
                 write_error_pieces(Context, 0, abstract_monotype_workaround,
                     !IO)
             ;
-                VerboseErrors = no
+                VerboseErrors = no,
+                globals.io_set_extra_error_info(yes, !IO)
             ),
             io__set_exit_status(1, !IO)
         ;
Index: assertion.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/assertion.m,v
retrieving revision 1.37
diff -u -r1.37 assertion.m
--- assertion.m	8 Aug 2005 02:57:08 -0000	1.37
+++ assertion.m	13 Sep 2005 07:00:58 -0000
@@ -889,7 +889,8 @@
             words("implementation section or move "),
             words("the definition into the interface.")], !IO)
     ;
-        VerboseErrors = no
+        VerboseErrors = no,
+        globals.io_set_extra_error_info(yes, !IO)
     ).

 %-----------------------------------------------------------------------------%
Index: check_typeclass.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/check_typeclass.m,v
retrieving revision 1.77
diff -u -r1.77 check_typeclass.m
--- check_typeclass.m	12 Sep 2005 05:24:02 -0000	1.77
+++ check_typeclass.m	13 Sep 2005 07:09:12 -0000
@@ -1789,7 +1789,8 @@
 		],
 		write_error_pieces_not_first_line(Context, 0, Msg, !IO)
 	;
-		VerboseErrors = no
+		VerboseErrors = no,
+		globals.io_set_extra_error_info(yes, !IO)
 	).

 %---------------------------------------------------------------------------%
Index: det_report.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/det_report.m,v
retrieving revision 1.104
diff -u -r1.104 det_report.m
--- det_report.m	30 Aug 2005 04:11:48 -0000	1.104
+++ det_report.m	13 Sep 2005 07:12:12 -0000
@@ -284,7 +284,8 @@
                 words("for the following determinism(s):") |
                 DetismPieces], !IO)
         ;
-            VerboseErrors = no
+            VerboseErrors = no,
+            globals.io_set_extra_error_info(yes, !IO)
         ),
         module_info_incr_errors(!ModuleInfo)
     ).
@@ -378,7 +379,8 @@
             write_error_pieces_not_first_line(FuncContext, 0,
                 [words(ExtMsg)], !IO)
         ;
-            VerboseErrors = no
+            VerboseErrors = no,
+            globals.io_set_extra_error_info(yes, !IO)
         ),
         module_info_incr_errors(!ModuleInfo)
     ;
@@ -1141,6 +1143,7 @@
         Pieces = Pieces0 ++ Pieces1
     ;
         VerboseErrors = no,
+        globals.io_set_extra_error_info(yes, !IO),
         Pieces = Pieces0
     ),
     write_error_pieces(Context, 0, Pieces, !IO).
@@ -1155,7 +1158,8 @@
             words("the `--fully-strict' option.")],
         Pieces = Pieces0 ++ Pieces1
     ;
-        VerboseErrors = no,
+        VerboseErrors = no,
+        globals.io_set_extra_error_info(yes, !IO),
         Pieces = Pieces0
     ),
     write_error_pieces(Context, 0, Pieces, !IO).
@@ -1181,6 +1185,7 @@
         Pieces = Pieces0 ++ Pieces1
     ;
         VerboseErrors = no,
+        globals.io_set_extra_error_info(yes, !IO),
         Pieces = Pieces0
     ),
     write_error_pieces(Context, 0, Pieces, !IO).
@@ -1237,7 +1242,8 @@
             words("you must do it explicitly.)")],
         write_error_pieces_not_first_line(Context, 0, VerbosePieces, !IO)
     ;
-        VerboseErrors = no
+        VerboseErrors = no,
+        globals.io_set_extra_error_info(yes, !IO)
     ).
 det_report_msg(cc_unify_in_wrong_context(GoalInfo, Var, Type, VarSet,
         GoalContext), _ModuleInfo, !IO) :-
@@ -1285,7 +1291,8 @@
             words("you must do it explicitly.)")],
         write_error_pieces_not_first_line(Context, 0, VerbosePieces, !IO)
     ;
-        VerboseErrors = no
+        VerboseErrors = no,
+        globals.io_set_extra_error_info(yes, !IO)
     ).
 det_report_msg(cc_pred_in_wrong_context(GoalInfo, Detism, PredId, _ModeId),
         ModuleInfo, !IO) :-
@@ -1366,7 +1373,8 @@
             words("det, cc_multi and erroneous.")],
         write_error_pieces_not_first_line(Context, 0, VerbosePieces, !IO)
     ;
-        VerboseErrors = no
+        VerboseErrors = no,
+        globals.io_set_extra_error_info(yes, !IO)
     ).
 det_report_msg(will_not_throw_with_erroneous(PredId, ProcId), ModuleInfo,
         !IO) :-
Index: globals.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/globals.m,v
retrieving revision 1.68
diff -u -r1.68 globals.m
--- globals.m	1 Sep 2005 05:28:28 -0000	1.68
+++ globals.m	14 Sep 2005 03:04:25 -0000
@@ -6,8 +6,6 @@
 % Public License - see the file COPYING in the Mercury distribution.
 %-----------------------------------------------------------------------------%

-:- module libs__globals.
-
 % Main author: fjh.

 % This module exports the `globals' type and associated access predicates.
@@ -17,6 +15,8 @@

 %-----------------------------------------------------------------------------%

+:- module libs__globals.
+
 :- interface.

 :- import_module libs__options.
@@ -31,6 +31,8 @@
 :- import_module map.
 :- import_module std_util.

+%-----------------------------------------------------------------------------%
+
 :- type globals.

 :- type compilation_target
@@ -105,6 +107,7 @@
     ;       size_data_elems.

     % Map from module name to file name.
+    %
 :- type source_file_map == map(module_name, string).

 :- type maybe_thread_safe == bool.
@@ -118,8 +121,9 @@
     is semidet.

 %-----------------------------------------------------------------------------%
-
-    % Access predicates for the `globals' structure.
+%
+% Access predicates for the `globals' structure
+%

 :- pred globals__init(option_table::di, compilation_target::di, gc_method::di,
     tags_method::di, termination_norm::di, termination_norm::di,
@@ -143,6 +147,7 @@
     is det.
 :- pred globals__get_maybe_thread_safe(globals::in, maybe_thread_safe::out)
     is det.
+:- pred globals__get_extra_error_info(globals::in, bool::out) is det.

 :- pred globals__set_option(option::in, option_data::in,
     globals::in, globals::out) is det.
@@ -157,6 +162,8 @@
 :- pred globals__set_trace_level_none(globals::in, globals::out) is det.
 :- pred globals__set_source_file_map(maybe(source_file_map)::in,
     globals::in, globals::out) is det.
+:- pred globals__set_extra_error_info(bool::in, globals::in, globals::out)
+    is det.

 :- pred globals__lookup_option(globals::in, option::in, option_data::out)
     is det.
@@ -173,8 +180,9 @@
     list(string)::out) is det.

 %-----------------------------------------------------------------------------%
-
-    % More complex options
+%
+% More complex options
+%

     % Check if static code addresses are available in the
     % current grade of compilation.
@@ -193,9 +201,10 @@
 :- pred globals__imported_is_constant(bool::in, bool::in, bool::out) is det.

 %-----------------------------------------------------------------------------%
-
-    % Access predicates for storing a `globals' structure in the
-    % io__state using io__set_globals and io__get_globals.
+%
+% Access predicates for storing a `globals' structure in the io.state
+% using io.set_globals and io.get_globals.
+%

 :- pred globals__io_init(option_table::di, compilation_target::in,
     gc_method::in, tags_method::in, termination_norm::in,
@@ -224,6 +233,8 @@
 :- pred globals__io_get_maybe_thread_safe(maybe_thread_safe::out,
     io::di, io::uo) is det.

+:- pred globals__io_get_extra_error_info(bool::out, io::di, io::uo) is det.
+
 :- pred globals__io_get_globals(globals::out, io::di, io::uo) is det.

 :- pred globals__io_set_globals(globals::di, io::di, io::uo) is det.
@@ -235,6 +246,7 @@
 :- pred globals__io_set_tags_method(tags_method::in, io::di, io::uo) is det.
 :- pred globals__io_set_trace_level(trace_level::in, io::di, io::uo) is det.
 :- pred globals__io_set_trace_level_none(io::di, io::uo) is det.
+:- pred globals__io_set_extra_error_info(bool::in, io::di, io::uo) is det.

 :- pred globals__io_lookup_option(option::in, option_data::out,
     io::di, io::uo) is det.
@@ -266,6 +278,8 @@
 :- import_module std_util.
 :- import_module string.

+%-----------------------------------------------------------------------------%
+
 convert_target(String, Target) :-
     convert_target_2(string__to_lower(String), Target).

@@ -343,7 +357,12 @@
                 trace_suppress_items    :: trace_suppress_items,
                 source_file_map         :: maybe(source_file_map),
                 have_printed_usage      :: bool,
-                maybe_thread_safe       :: bool
+                maybe_thread_safe       :: bool,
+                extra_error_info        :: bool
+                                        % Is there extra information
+                                        % about errors available, that
+                                        % could be printed out if `-E'
+                                        % were enabled.
             ).

 globals__init(Options, Target, GC_Method, TagsMethod,
@@ -351,7 +370,7 @@
         MaybeThreadSafe,
     globals(Options, Target, GC_Method, TagsMethod,
         TerminationNorm, Termination2Norm, TraceLevel, TraceSuppress,
-        no, no, MaybeThreadSafe)).
+        no, no, MaybeThreadSafe, no)).

 globals__get_options(Globals, Globals ^ options).
 globals__get_target(Globals, Globals ^ target).
@@ -363,6 +382,7 @@
 globals__get_trace_suppress(Globals, Globals ^ trace_suppress_items).
 globals__get_source_file_map(Globals, Globals ^ source_file_map).
 globals__get_maybe_thread_safe(Globals, Globals ^ maybe_thread_safe).
+globals__get_extra_error_info(Globals, Globals ^ extra_error_info).

 globals__get_backend_foreign_languages(Globals, ForeignLangs) :-
     globals__lookup_accumulating_option(Globals, backend_foreign_languages,
@@ -399,6 +419,9 @@
     globals__get_options(Globals, OptionTable),
     map__lookup(OptionTable, Option, OptionData).

+globals__set_extra_error_info(ExtraErrorInfo, Globals,
+    Globals ^ extra_error_info := ExtraErrorInfo).
+
 %-----------------------------------------------------------------------------%

 globals__lookup_bool_option(Globals, Option, Value) :-
@@ -546,6 +569,10 @@
     globals__io_get_globals(Globals, !IO),
     globals__get_maybe_thread_safe(Globals, MaybeThreadSafe).

+globals__io_get_extra_error_info(ExtraErrorInfo, !IO) :-
+    globals__io_get_globals(Globals, !IO),
+    globals__get_extra_error_info(Globals, ExtraErrorInfo).
+
 globals__io_get_globals(Globals, !IO) :-
     io__get_globals(UnivGlobals, !IO),
     ( univ_to_type(UnivGlobals, Globals0) ->
@@ -599,6 +626,16 @@
         % uniqueness and io__set_globals
     globals__io_set_globals(Globals, !IO).

+globals__io_set_extra_error_info(ExtraErrorInfo, !IO) :-
+    some [!Globals] (
+        globals__io_get_globals(!:Globals, !IO),
+        globals__set_extra_error_info(ExtraErrorInfo, !Globals),
+        unsafe_promise_unique(!Globals),
+        % XXX there is a bit of a design flaw with regard to
+        % uniqueness and io__set_globals
+        globals__io_set_globals(!.Globals, !IO)
+    ).
+
     % This predicate is needed because mercury_compile.m doesn't know
     % anything about type trace_level.
 globals__io_set_trace_level_none(!IO) :-
@@ -651,3 +688,5 @@
     globals__io_set_globals(Globals, !IO).

 %-----------------------------------------------------------------------------%
+:- end_module globals.
+%-----------------------------------------------------------------------------%
Index: magic_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/magic_util.m,v
retrieving revision 1.52
diff -u -r1.52 magic_util.m
--- magic_util.m	13 Sep 2005 04:56:07 -0000	1.52
+++ magic_util.m	13 Sep 2005 07:14:12 -0000
@@ -1888,11 +1888,11 @@
 			words("contains abstract types.")].
 magic_util__report_argument_error(_Context, output_aditi_state,
 		ArgPiece, _, Pieces) :-
-	Pieces = [ArgPiece, words("is an output `aditi:state'.")].
+	Pieces = [ArgPiece, words("is an output `aditi.state'.")].
 magic_util__report_argument_error(_Context, embedded_aditi_state,
 		ArgPiece, _, Pieces) :-
 	Pieces = [words("the type of"), ArgPiece,
-		words("contains an embedded `aditi:state'.")].
+		words("contains an embedded `aditi.state'.")].

 :- pred magic_util__report_linearity_error(module_info::in, term__context::in,
 	bool::in, linearity_error::in, list(format_component)::out) is det.
Index: make_hlds_error.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make_hlds_error.m,v
retrieving revision 1.2
diff -u -r1.2 make_hlds_error.m
--- make_hlds_error.m	5 Sep 2005 03:45:55 -0000	1.2
+++ make_hlds_error.m	13 Sep 2005 07:14:43 -0000
@@ -161,7 +161,8 @@
             io__write_string(" are the following:\n", !IO),
             list__foldl(output_mode_decl_for_pred_info(PredInfo), ProcIds, !IO)
         ;
-            VerboseErrors = no
+            VerboseErrors = no,
+            globals.io_set_extra_error_info(yes, !IO)
         )
     ).

Index: mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.346
diff -u -r1.346 mercury_compile.m
--- mercury_compile.m	13 Sep 2005 04:56:07 -0000	1.346
+++ mercury_compile.m	13 Sep 2005 06:50:20 -0000
@@ -437,14 +437,21 @@
         ;
             % If we found some errors, but the user didn't enable
             % the `-E' (`--verbose-errors') option, give them a
-            % hint about it.
-
+            % hint about it.  Of course, we should only output the
+            % hint when we have further information to give the user.
+
             globals__lookup_bool_option(Globals, verbose_errors,
                 VerboseErrors),
+            globals__get_extra_error_info(Globals, ExtraErrorInfo),
             (
                 VerboseErrors = no,
-                io__write_string("For more information, " ++
-                    "try recompiling with `-E'.\n", !IO)
+                (
+                    ExtraErrorInfo = yes,
+                    io__write_string("For more information, " ++
+                        "recompile with `-E'.\n", !IO)
+                ;
+                    ExtraErrorInfo = no
+                )
             ;
                 VerboseErrors = yes
             )
Index: mode_errors.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mode_errors.m,v
retrieving revision 1.90
diff -u -r1.90 mode_errors.m
--- mode_errors.m	12 Sep 2005 05:24:17 -0000	1.90
+++ mode_errors.m	13 Sep 2005 07:30:42 -0000
@@ -247,6 +247,10 @@

 report_mode_error(ModeError, ModeInfo, !IO) :-
     Specs = mode_error_to_specs(ModeError, ModeInfo),
+    % XXX This module needs some rearrangement for the global extra erro info
+    % flag to be respected properly.  In the meantime we just set it to yes
+    % because that was the original behaviour for this module was.
+    globals.io_set_extra_error_info(yes, !IO),
     write_error_specs(Specs, !IO).

 report_mode_warning(ModeInfo, Warning, !IO) :-
@@ -574,6 +578,7 @@
         )
     ;
         VerboseErrors = no,
+        % XXX We need to set the extra error flag here.
         Pieces2 = []
     ),
     Specs = [mode_info_context_to_spec(ModeInfo),
Index: modes.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modes.m,v
retrieving revision 1.310
diff -u -r1.310 modes.m
--- modes.m	5 Sep 2005 07:09:50 -0000	1.310
+++ modes.m	13 Sep 2005 07:25:13 -0000
@@ -3358,6 +3358,7 @@
             words("is not currently implemented.")]
     ;
         VerboseErrors = no,
+        globals.io_set_extra_error_info(yes, !IO),
         Pieces2 = []
     ),
     write_error_pieces(Context, 0, Pieces1 ++ Pieces2, !IO),
Index: module_qual.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/module_qual.m,v
retrieving revision 1.113
diff -u -r1.113 module_qual.m
--- module_qual.m	12 Sep 2005 05:24:18 -0000	1.113
+++ module_qual.m	13 Sep 2005 07:26:38 -0000
@@ -1432,6 +1432,7 @@
             words("may be necessary."), nl]
     ;
         Verbose = no,
+        globals.io_set_extra_error_info(yes, !IO),
         Pieces2 = []
     ),
     write_error_pieces(Context, 0, Pieces1 ++ Pieces2, !IO),
Index: modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.341
diff -u -r1.341 modules.m
--- modules.m	12 Sep 2005 05:24:18 -0000	1.341
+++ modules.m	13 Sep 2005 07:27:07 -0000
@@ -2130,7 +2130,8 @@
                 fixed("or `:- mode'"),
                 fixed("declaration.")], !IO)
         ;
-            VerboseErrors = no
+            VerboseErrors = no,
+            globals.io_set_extra_error_info(yes, !IO)
         )
     ;
         ExportWarning = no
@@ -2801,7 +2802,8 @@
             words("There is no need to explicitly import them.")],
             !IO)
     ;
-        VerboseErrors = no
+        VerboseErrors = no,
+        globals.io_set_extra_error_info(yes, !IO)
     ).

     % This predicate ensures that all every import_module declaration is
@@ -6533,7 +6535,8 @@
         io__write_string(SubModule, !IO),
         io__write_string("'.\n", !IO)
     ;
-        VerboseErrors = no
+        VerboseErrors = no,
+        globals.io_set_extra_error_info(yes, !IO)
     ),
     io__set_exit_status(1, !IO).

Index: post_typecheck.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/post_typecheck.m,v
retrieving revision 1.78
diff -u -r1.78 post_typecheck.m
--- post_typecheck.m	12 Sep 2005 05:24:20 -0000	1.78
+++ post_typecheck.m	13 Sep 2005 07:25:58 -0000
@@ -407,7 +407,8 @@
 	prog_out__write_context(Context),
 	io__write_string("  bound to the builtin type `void'.\n"),
 	globals__io_lookup_bool_option(verbose_errors, VerboseErrors),
-	( { VerboseErrors = yes } ->
+	(
+		{ VerboseErrors = yes },
 		io__write_strings([
 "\tThe body of the clause contains a call to a polymorphic predicate,\n",
 "\tbut I can't determine which version should be called,\n",
@@ -418,7 +419,8 @@
 "\tyou'll have to work it out yourself.  My apologies.)\n"
 			])
 	;
-		[]
+		{ VerboseErrors = no },
+		globals.io_set_extra_error_info(yes)
 	).

 :- pred write_type_var_list(assoc_list(prog_var, (type))::in, prog_context::in,
Index: purity.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/purity.m,v
retrieving revision 1.77
diff -u -r1.77 purity.m
--- purity.m	30 Aug 2005 04:11:57 -0000	1.77
+++ purity.m	13 Sep 2005 07:24:45 -0000
@@ -1006,6 +1006,7 @@
             words("no impurity declaration.")]
     ;
         VerboseErrors = no,
+        globals.io_set_extra_error_info(yes, !IO),
         Pieces = Pieces1
     ),
     write_error_pieces(Context, 0, Pieces, !IO),
@@ -1059,6 +1060,7 @@
         Pieces = PredContextPieces ++ Pieces1 ++ Pieces2
     ;
         VerboseErrors = no,
+        globals.io_set_extra_error_info(yes, !IO),
         Pieces = PredContextPieces ++ Pieces1
     ),
     write_error_pieces(Context, 0, Pieces, !IO),
Index: stratify.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/stratify.m,v
retrieving revision 1.39
diff -u -r1.39 stratify.m
--- stratify.m	27 Aug 2005 09:41:59 -0000	1.39
+++ stratify.m	13 Sep 2005 07:24:02 -0000
@@ -898,7 +898,8 @@
 		io__write_string("\tcan cause problems for bottom up " ++
 			"evaluation of the predicate/function.\n", !IO)
 	;
-		VerboseErrors = no
+		VerboseErrors = no,
+		globals.io_set_extra_error_info(yes, !IO)
 	).

 %-----------------------------------------------------------------------------%
Index: typecheck_errors.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/typecheck_errors.m,v
retrieving revision 1.4
diff -u -r1.4 typecheck_errors.m
--- typecheck_errors.m	12 Sep 2005 05:24:28 -0000	1.4
+++ typecheck_errors.m	13 Sep 2005 06:55:24 -0000
@@ -223,7 +223,8 @@
 			io__write_string(
 				"  Every if-then must have an else.\n", !IO)
 		;
-			VerboseErrors = no
+			VerboseErrors = no,
+			globals__io_set_extra_error_info(yes, !IO)
 		)
 	;
 		PredName = unqualified("else"),
@@ -254,7 +255,8 @@
 			io__write_string(
 				"  Every if-then must have an `else'.\n", !IO)
 		;
-			VerboseErrors = no
+			VerboseErrors = no,
+			globals__io_set_extra_error_info(yes, !IO)
 		)
 	;
 		PredName = unqualified("apply"),
@@ -277,7 +279,8 @@
 			io__write_string("  Such markers only belong " ++
 				"before predicate calls.\n", !IO)
 		;
-			VerboseErrors = no
+			VerboseErrors = no,
+			globals__io_set_extra_error_info(yes, !IO)
 		)
 	;
 		PredName = unqualified("some"),
@@ -325,6 +328,7 @@
 			fixed("`my_apply(Func, X, Y) :- apply(Func, X, Y).'")]
 	;
 		VerboseErrors = no,
+		globals__io_set_extra_error_info(yes, !IO),
 		Pieces2 = []
 	),
 	write_error_pieces_not_first_line(Context, 0, Pieces1 ++ Pieces2, !IO).
@@ -356,6 +360,7 @@
 		list__append(SmallWarning, VerboseWarning, Warning)
 	;
 		VerboseErrors = no,
+		globals__io_set_extra_error_info(yes, !IO),
 		Warning = SmallWarning
 	),
 	error_util__report_warning(Context, 0, Warning, !IO).
@@ -1382,7 +1387,8 @@
 		),
 		write_type_assign_set(TypeAssignSet, VarSet, !IO)
 	;
-		VerboseErrors = no
+		VerboseErrors = no,
+		globals__io_set_extra_error_info(yes, !IO)
 	).

 :- pred write_args_type_assign_set_msg(args_type_assign_set::in,
@@ -1401,7 +1407,8 @@
 		),
 		write_args_type_assign_set(ArgTypeAssignSet, VarSet, !IO)
 	;
-		VerboseErrors = no
+		VerboseErrors = no,
+		globals__io_set_extra_error_info(yes, !IO)
 	).

 :- pred output_type((type)::in, tvarset::in, head_type_params::in,

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