[m-rev.] diff: better error messages for bugs in lists

Zoltan Somogyi zs at csse.unimelb.edu.au
Sat Jan 6 21:50:41 AEDT 2007


compiler/hlds_out.m:
	When generating contexts for use in error messages, replace long
	sequences of references to [|]/2 with a simple reference to the
	position of the argument in the list.

	Fix some inappropriate code factoring that lead to contorted code.

	Delete a bunch of predicates for directly writing out several kinds
	of data structures. The calls to them have all been replaced some time
	ago with calls to parallel versions that return format_component lists
	for use in error_specs.

tests/invalid/error_in_list.{m,err_exp}:
	New test case to test the new error message form.

tests/invalid/Mmakefile:
	Enable the new test case.

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/libatomic_ops-1.2
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/doc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing boehm_gc/windows-untested
cvs diff: Diffing boehm_gc/windows-untested/vc60
cvs diff: Diffing boehm_gc/windows-untested/vc70
cvs diff: Diffing boehm_gc/windows-untested/vc71
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/hlds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.421
diff -u -r1.421 hlds_out.m
--- compiler/hlds_out.m	6 Jan 2007 09:23:34 -0000	1.421
+++ compiler/hlds_out.m	6 Jan 2007 09:44:35 -0000
@@ -76,29 +76,24 @@
     io::di, io::uo) is det.
 :- func pred_proc_id_pair_to_string(module_info, pred_id, proc_id) = string.
 
-:- pred write_call_id(call_id::in, io::di, io::uo) is det.
 :- func call_id_to_string(call_id) = string.
 
-    % Write "argument %i of call to pred_or_func `foo/n'". The pred_markers
-    % argument is used to tell if the calling predicate is a type class method
-    % implementation; if so, we omit the "call to" part, since the user didn't
-    % write any explicit call.
+    % Generate a message of the form "argument %i of call to pred_or_func
+    % `foo/n'". The pred_markers argument is used to tell if the calling
+    % predicate is a type class method implementation; if so, we omit the
+    % "call to" part, since the user didn't write any explicit call.
     %
-:- pred write_call_arg_id(call_id::in, int::in, pred_markers::in,
-    io::di, io::uo) is det.
 :- func call_arg_id_to_string(call_id, int, pred_markers) = string.
 
-    % write_unify_context/5 writes out a message such as
+    % unify_context_to_pieces generates a message such as
     %   foo.m:123:   in argument 3 of functor `foo/5':
     %   foo.m:123:   in unification of `X' and `blah':
     % based on the unify_context and prog_context.
     %
-:- pred write_unify_context(unify_context::in, prog_context::in,
-    io::di, io::uo) is det.
 :- pred unify_context_to_pieces(unify_context::in,
     list(format_component)::in, list(format_component)::out) is det.
 
-    % write_unify_context_first/6 is the same as above, except that
+    % unify_context_first_to_pieces is the same as above, except that
     % it also takes and returns a bool which specifies whether this is the
     % start of a sentence. If the first argument is `yes', then it means
     % this is the first line of an error message, so the message starts with
@@ -106,22 +101,17 @@
     %   foo.m:123:   In argument 3 of functor `foo/5':
     %   foo.m:123:   in unification of `X' and `blah':
     % The bool returned as the second argument will be `no' unless nothing
-    % was printed out, in which case it will be the same as the first arg.
+    % was generated, in which case it will be the same as the first arg.
     %
-:- pred write_unify_context_first(bool::in, bool::out, unify_context::in,
-    prog_context::in, io::di, io::uo) is det.
 :- pred unify_context_first_to_pieces(bool::in, bool::out, unify_context::in,
     list(format_component)::in, list(format_component)::out) is det.
 
-:- pred write_determinism(determinism::in, io::di, io::uo) is det.
 :- func determinism_to_string(determinism) = string.
 
-:- pred write_can_fail(can_fail::in, io::di, io::uo) is det.
 :- func can_fail_to_string(can_fail) = string.
 
 :- pred write_eval_method(eval_method::in, io::di, io::uo) is det.
 
-:- pred write_import_status(import_status::in, io::di, io::uo) is det.
 :- func import_status_to_string(import_status) = string.
 
 %-----------------------------------------------------------------------------%
@@ -412,21 +402,11 @@
     Str = pred_id_to_string(ModuleInfo, PredId)
         ++ " mode " ++ int_to_string(ModeNum).
 
-write_call_id(CallId, !IO) :-
-    Str = call_id_to_string(CallId),
-    io.write_string(Str, !IO).
-
 call_id_to_string(plain_call_id(PredCallId)) =
     simple_call_id_to_string(PredCallId).
 call_id_to_string(generic_call_id(GenericCallId)) =
     generic_call_id_to_string(GenericCallId).
 
-:- pred write_generic_call_id(generic_call_id::in, io::di, io::uo) is det.
-
-write_generic_call_id(GenericCallId, !IO) :-
-    Str = generic_call_id_to_string(GenericCallId),
-    io.write_string(Str, !IO).
-
 :- func generic_call_id_to_string(generic_call_id) = string.
 
 generic_call_id_to_string(gcid_higher_order(Purity, PredOrFunc, _)) =
@@ -446,10 +426,6 @@
 cast_type_to_string(equiv_type_cast) = "equiv_type_cast".
 cast_type_to_string(exists_cast) = "exists_cast".
 
-write_call_arg_id(CallId, ArgNum, PredMarkers, !IO) :-
-    Str = call_arg_id_to_string(CallId, ArgNum, PredMarkers),
-    io.write_string(Str, !IO).
-
 call_arg_id_to_string(CallId, ArgNum, PredMarkers) = Str :-
     ( ArgNum =< 0 ->
         % Argument numbers that are less than or equal to zero
@@ -534,62 +510,26 @@
 
 %-----------------------------------------------------------------------------%
 
-write_unify_context(UnifyContext, Context, !IO) :-
-    write_unify_context_first(no, _, UnifyContext, Context, !IO).
-
 unify_context_to_pieces(UnifyContext, !Pieces) :-
     unify_context_first_to_pieces(no, _, UnifyContext, !Pieces).
 
-write_unify_context_first(!First, UnifyContext, Context, !IO) :-
-    UnifyContext = unify_context(MainContext, RevSubContexts),
-    list.reverse(RevSubContexts, SubContexts),
-    write_unify_main_context(!First, MainContext, Context, !IO),
-    write_unify_sub_contexts(!First, SubContexts, Context, !IO).
-
 unify_context_first_to_pieces(!First, UnifyContext, !Pieces) :-
     UnifyContext = unify_context(MainContext, RevSubContexts),
     list.reverse(RevSubContexts, SubContexts),
     unify_main_context_to_pieces(!First, MainContext, !Pieces),
     unify_sub_contexts_to_pieces(!First, SubContexts, !Pieces).
 
-:- pred write_unify_main_context(bool::in, bool::out,
-    unify_main_context::in, prog_context::in, io::di, io::uo) is det.
-
-write_unify_main_context(!First, umc_explicit, _, !IO).
-write_unify_main_context(!First, umc_head(ArgNum), Context, !IO) :-
-    write_in_argument(!.First, ArgNum, Context, !IO),
-    !:First = no,
-    io.write_string(" of clause head:\n", !IO).
-write_unify_main_context(!First, umc_head_result, Context, !IO) :-
-    start_in_message(!.First, Context, !IO),
-    !:First = no,
-    io.write_string("function result term of clause head:\n", !IO).
-write_unify_main_context(!First, umc_call(CallId, ArgNum), Context, !IO) :-
-    start_in_message(!.First, Context, !IO),
-    !:First = no,
-    % The markers argument below is used only for type class method
-    % implementations defined using the named syntax rather than
-    % the clause syntax, and the bodies of such procedures should
-    % only contain a single call, so we shouldn't get unifications
-    % nested inside calls.  Hence we can safely initialize the
-    % markers to empty here.  (Anyway the worst possible consequence
-    % is slightly sub-optimal text for an error message.)
-    init_markers(Markers),
-    write_call_arg_id(CallId, ArgNum, Markers, !IO),
-    io.write_string(":\n", !IO).
-write_unify_main_context(!First, umc_implicit(Source), Context, !IO) :-
-    start_in_message(!.First, Context, !IO),
-    io.format("implicit %s unification:\n", [s(Source)], !IO).
-
 :- pred unify_main_context_to_pieces(bool::in, bool::out,
     unify_main_context::in,
     list(format_component)::in, list(format_component)::out) is det.
 
 unify_main_context_to_pieces(!First, umc_explicit, !Pieces).
 unify_main_context_to_pieces(!First, umc_head(ArgNum), !Pieces) :-
-    in_argument_to_pieces(!.First, ArgNum, !Pieces),
+    start_in_message_to_pieces(!.First, !Pieces),
     !:First = no,
-    !:Pieces = !.Pieces ++ [words("of clause head:"), nl].
+    ArgNumStr = int_to_string(ArgNum),
+    !:Pieces = !.Pieces ++
+        [words("argument"), fixed(ArgNumStr), words("of clause head:"), nl].
 unify_main_context_to_pieces(!First, umc_head_result, !Pieces) :-
     start_in_message_to_pieces(!.First, !Pieces),
     !:First = no,
@@ -607,66 +547,73 @@
     % is slightly sub-optimal text for an error message.)
     init_markers(Markers),
     ArgIdStr = call_arg_id_to_string(CallId, ArgNum, Markers),
-    !:Pieces = !.Pieces ++ [words(ArgIdStr ++ ":"), nl].
+    !:Pieces = !.Pieces ++ [words(ArgIdStr), suffix(":"), nl].
 unify_main_context_to_pieces(!First, umc_implicit(Source), !Pieces) :-
     start_in_message_to_pieces(!.First, !Pieces),
     string.format("implicit %s unification:\n", [s(Source)], Msg),
     !:Pieces = !.Pieces ++ [words(Msg), nl].
 
-:- pred write_unify_sub_contexts(bool::in, bool::out,
-    unify_sub_contexts::in, prog_context::in, io::di, io::uo) is det.
-
-write_unify_sub_contexts(!First, [], _, !IO).
-write_unify_sub_contexts(!First, [ConsId - ArgNum | SubContexts], Context,
-        !IO) :-
-    write_in_argument(!.First, ArgNum, Context, !IO),
-    !:First = no,
-    io.write_string(" of functor `", !IO),
-    write_cons_id(ConsId, !IO),
-    io.write_string("':\n", !IO),
-    write_unify_sub_contexts(!First, SubContexts, Context, !IO).
-
 :- pred unify_sub_contexts_to_pieces(bool::in, bool::out,
     unify_sub_contexts::in,
     list(format_component)::in, list(format_component)::out) is det.
 
 unify_sub_contexts_to_pieces(!First, [], !Pieces).
-unify_sub_contexts_to_pieces(!First, [ConsId - ArgNum | SubContexts],
-        !Pieces) :-
-    in_argument_to_pieces(!.First, ArgNum, !Pieces),
-    !:First = no,
-    NewPieces = [words("of functor"),
-        fixed("`" ++ cons_id_to_string(ConsId) ++ "':"), nl],
-    !:Pieces = !.Pieces ++ NewPieces,
-    unify_sub_contexts_to_pieces(!First, SubContexts, !Pieces).
+unify_sub_contexts_to_pieces(!First, [SubContext | SubContexts], !Pieces) :-
+    (
+        contexts_describe_list_element([SubContext | SubContexts],
+            0, ElementNum, AfterContexts)
+    ->
+        in_element_to_pieces(!.First, ElementNum, !Pieces),
+        !:First = no,
+        unify_sub_contexts_to_pieces(!First, AfterContexts, !Pieces)
+    ;
+        in_argument_to_pieces(!.First, SubContext, !Pieces),
+        !:First = no,
+        unify_sub_contexts_to_pieces(!First, SubContexts, !Pieces)
+    ).
 
-:- pred write_in_argument(bool::in, int::in, prog_context::in,
-    io::di, io::uo) is det.
+:- pred contexts_describe_list_element(unify_sub_contexts::in,
+    int::in, int::out, unify_sub_contexts::out) is semidet.
 
-write_in_argument(First, ArgNum, Context, !IO) :-
-    start_in_message(First, Context, !IO),
-    io.write_string("argument ", !IO),
-    io.write_int(ArgNum, !IO).
+contexts_describe_list_element([SubContext | SubContexts],
+        NumElementsBefore, ElementNum, AfterContexts) :-
+    SubContext = ConsId - ArgNum,
+    ConsId = cons(Functor, 2),
+    (
+        Functor = unqualified("[|]")
+    ;
+        Functor = qualified(ModuleSymName, "[|]"),
+        is_std_lib_module_name(ModuleSymName, "list")
+    ),
+    (
+        ArgNum = 1,
+        ElementNum = NumElementsBefore,
+        AfterContexts = SubContexts
+    ;
+        ArgNum = 2,
+        contexts_describe_list_element(SubContexts,
+            NumElementsBefore + 1, ElementNum, AfterContexts)
+    ).
 
-:- pred in_argument_to_pieces(bool::in, int::in,
+:- pred in_argument_to_pieces(bool::in, pair(cons_id, int)::in,
     list(format_component)::in, list(format_component)::out) is det.
 
-in_argument_to_pieces(First, ArgNum, !Pieces) :-
+in_argument_to_pieces(First, SubContext, !Pieces) :-
     start_in_message_to_pieces(First, !Pieces),
+    SubContext = ConsId - ArgNum,
     ArgNumStr = int_to_string(ArgNum),
-    !:Pieces = !.Pieces ++ [words("argument"), words(ArgNumStr)].
+    !:Pieces = !.Pieces ++ [words("argument"), fixed(ArgNumStr),
+        words("of functor"),
+        prefix("`"), fixed(cons_id_to_string(ConsId)), suffix("':"), nl].
 
-:- pred start_in_message(bool::in, prog_context::in, io::di, io::uo) is det.
+:- pred in_element_to_pieces(bool::in, int::in,
+    list(format_component)::in, list(format_component)::out) is det.
 
-start_in_message(First, Context, !IO) :-
-    prog_out.write_context(Context, !IO),
-    (
-        First = yes,
-        io.write_string("  In ", !IO)
-    ;
-        First = no,
-        io.write_string("  in ", !IO)
-    ).
+in_element_to_pieces(First, ElementNum, !Pieces) :-
+    start_in_message_to_pieces(First, !Pieces),
+    ElementNumStr = int_to_string(ElementNum),
+    !:Pieces = !.Pieces ++ [words("list element"),
+        prefix("#"), fixed(ElementNumStr), suffix(":"), nl].
 
 :- pred start_in_message_to_pieces(bool::in,
     list(format_component)::in, list(format_component)::out) is det.
@@ -854,7 +801,7 @@
         io.write_string(", category: ", !IO),
         write_pred_or_func(PredOrFunc, !IO),
         io.write_string(", status: ", !IO),
-        write_import_status(ImportStatus, !IO),
+        io.write_string(import_status_to_string(ImportStatus), !IO),
         io.write_string("\n", !IO),
         io.write_string("% goal_type: ", !IO),
         pred_info_get_goal_type(PredInfo, GoalType),
@@ -1345,7 +1292,7 @@
         write_indent(Indent, !IO),
         io.write_string("% determinism: ", !IO),
         goal_info_get_determinism(GoalInfo, Determinism),
-        write_determinism(Determinism, !IO),
+        io.write_string(determinism_to_string(Determinism), !IO),
         io.write_string("\n", !IO)
     ;
         true
@@ -1484,7 +1431,7 @@
         AppendVarNums, Indent, Follow, TypeQual, !IO) :-
     write_indent(Indent, !IO),
     io.write_string("( % ", !IO),
-    write_can_fail(CanFail, !IO),
+    io.write_string(can_fail_to_string(CanFail), !IO),
     io.write_string(" switch on `", !IO),
     mercury_output_var(VarSet, AppendVarNums, Var, !IO),
     io.write_string("'\n", !IO),
@@ -2928,9 +2875,6 @@
         write_vars(VarSet, AppendVarNums, Vars, !IO)
     ).
 
-write_import_status(Status, !IO) :-
-    io.write_string(import_status_to_string(Status), !IO).
-
 import_status_to_string(status_local) =
     "local".
 import_status_to_string(status_exported) =
@@ -3180,7 +3124,7 @@
             io.write_string("', line ", !IO),
             io.write_int(LineNumber, !IO),
             io.write_string(", status ", !IO),
-            write_import_status(Status, !IO),
+            io.write_string(import_status_to_string(Status), !IO),
             io.write_char('\n', !IO)
         ;
             true
@@ -3612,7 +3556,7 @@
     io.write_string(" of ", !IO),
     write_pred_id(ModuleInfo, PredId, !IO),
     io.write_string(" (", !IO),
-    write_determinism(InferredDeterminism, !IO),
+    io.write_string(determinism_to_string(InferredDeterminism), !IO),
     io.write_string("):\n", !IO),
 
     globals.io_lookup_string_option(dump_hlds_options, Verbose, !IO),
@@ -3806,9 +3750,6 @@
             !IO)
     ).
 
-write_determinism(Detism, !IO) :-
-    io.write_string(determinism_to_string(Detism), !IO).
-
 determinism_to_string(detism_det) = "det".
 determinism_to_string(detism_semi) = "semidet".
 determinism_to_string(detism_non) = "nondet".
@@ -3818,9 +3759,6 @@
 determinism_to_string(detism_erroneous) = "erroneous".
 determinism_to_string(detism_failure) = "failure".
 
-write_can_fail(CanFail, !IO) :-
-    io.write_string(can_fail_to_string(CanFail), !IO).
-
 can_fail_to_string(can_fail) = "can_fail".
 can_fail_to_string(cannot_fail) = "cannot_fail".
 
@@ -4329,6 +4267,7 @@
 :- pred write_short_reuse_description(short_reuse_description::in, 
     prog_varset::in, bool::in, 
     io::di, io::uo) is det.
+
 write_short_reuse_description(ShortDescription, VarSet, AppendVarnums, !IO):- 
     (
         ShortDescription = cell_died, 
@@ -4346,6 +4285,7 @@
     ).
 
 :- pred write_is_conditional(is_conditional::in, io::di, io::uo) is det.
+
 write_is_conditional(IsConditional, !IO) :- 
     (
         IsConditional = conditional_reuse,
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/base64
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/fixed
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/log4m
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/mopenssl
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/net
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/stream/tests
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing mdbcomp
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing slice
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
Index: tests/invalid/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/invalid/Mmakefile,v
retrieving revision 1.204
diff -u -r1.204 Mmakefile
--- tests/invalid/Mmakefile	27 Dec 2006 03:49:25 -0000	1.204
+++ tests/invalid/Mmakefile	4 Jan 2007 12:26:24 -0000
@@ -71,6 +71,7 @@
 	duplicate_modes \
 	duplicate_module_test \
 	erroneous_throw_promise \
+	error_in_list \
 	errors \
 	errors1 \
 	errors2 \
Index: tests/invalid/error_in_list.err_exp
===================================================================
RCS file: tests/invalid/error_in_list.err_exp
diff -N tests/invalid/error_in_list.err_exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/invalid/error_in_list.err_exp	4 Jan 2007 18:44:42 -0000
@@ -0,0 +1,15 @@
+error_in_list.m:011: In clause for function `f'/0:
+error_in_list.m:011:   in function result term of clause head:
+error_in_list.m:011:   in list element #4:
+error_in_list.m:011:   type error in unification of argument
+error_in_list.m:011:   and constant `"five"'.
+error_in_list.m:011:   argument has type `int',
+error_in_list.m:011:   constant `"five"' has type `string'.
+error_in_list.m:011: In clause for function `f'/0:
+error_in_list.m:011:   in function result term of clause head:
+error_in_list.m:011:   in list element #6:
+error_in_list.m:011:   type error in unification of argument
+error_in_list.m:011:   and constant `7.00000000000000'.
+error_in_list.m:011:   argument has type `int',
+error_in_list.m:011:   constant `7.00000000000000' has type `float'.
+For more information, recompile with `-E'.
Index: tests/invalid/error_in_list.m
===================================================================
RCS file: tests/invalid/error_in_list.m
diff -N tests/invalid/error_in_list.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/invalid/error_in_list.m	4 Jan 2007 12:17:19 -0000
@@ -0,0 +1,11 @@
+:- module error_in_list.
+
+:- interface.
+
+:- import_module list.
+
+:- func f = list(int).
+
+:- implementation.
+
+f = [1, 2, 3, 4, "five", 6, 7.0, 8].
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
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