Files
mercury/tests/invalid/errors2.err_exp
Zoltan Somogyi 3a1ed2efcb Replace simple_call_id with pf_sym_name_arity.
compiler/prog_data.m:
    Delete the simple_call_id data type, since it is isomorphic
    to the pf_sym_name_arity type, which more clearly specifies
    what is stored inside it.

compiler/prog_out.m:
    Rename (all three versions of) simple_call_id_to_string to
    pf_sym_name_orig_arity_to_string, both to conform to the change
    in the input data type, and to emphasize that the resulting string
    will contain the *original* arity of functions (which does not include
    the return value), which is one less than the arity in the
    pf_sym_name_arity structure (which, in accordance with the
    convention inside the compiler that the arity is the length
    of the argument list, *does* include the return value).

    Delete the provision inside simple_call_id_to_string, now
    pf_sym_name_orig_arity_to_string, for special handling of the names
    of the predicates we use to implement promises, because it seems that
    *none* of the call sites to any of the three versions of this function
    can actually pass to it the identity of such a predicate. These calls
    refer to a predicate or mode declaration item (which promise predicates
    do not have), to clause or foreign_proc items (which again, promise
    predicates cannot have) or calls to the predicate (promise predicates
    cannot be called).

    Delete the exported predicate simple_call_id_to_sym_name_arity.
    It was called from exactly one place, inside prog_out.m itself,
    and this diff inlines that call.

    Avoid unnecessary forwarding of work from prog_out.m to error_util.m.

    Delete (all three versions of) write_simple_call_id. The changes
    below replace all their (few) uses with calls to
    pf_sym_name_orig_arity_to_string.

compiler/error_util.m:
    Replace the simple_call() error piece with qual_pf_sym_name_orig_arity,
    and add a new version unqual_pf_sym_name_orig_arity. Their names
    explicitly say that they print the original arities of functions,
    also say whether they strip away any module qualification on the
    sym_name inside the pf_sym_name_arity. We prefer the unqual version
    in situations where the module qualifier is implicit, which usually means
    that it must be the same as the name of the module being compiled, because
    it reduces visual clutter for readers of error messages.

    Put {qual,unqual}_pf_sym_name_orig_arity next to their most closely
    related function symbols, {qual,unqual}_sym_name_arity, in the
    format_component type. (This yields a few inconsequential changes
    in the order of error_specs when sorted.)

compiler/add_class.m:
compiler/add_clause.m:
compiler/add_foreign_proc.m:
compiler/add_pragma.m:
compiler/add_pragma_tabling.m:
compiler/add_pragma_type_spec.m:
compiler/add_pred.m:
compiler/check_libgrades.m:
compiler/check_parse_tree_type_defns.m:
compiler/check_promise.m:
compiler/check_typeclass.m:
compiler/convert_parse_tree.m:
compiler/equiv_type.m:
compiler/goal_expr_to_goal.m:
compiler/hlds_data.m:
compiler/hlds_desc.m:
compiler/hlds_goal.m:
compiler/hlds_out_pred.m:
compiler/hlds_out_util.m:
compiler/hlds_pred.m:
compiler/inst_util.m:
compiler/llds_out_instr.m:
compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/make_hlds_error.m:
compiler/make_hlds_warn.m:
compiler/mark_tail_calls.m:
compiler/ml_unify_gen_construct.m:
compiler/mlds_to_c_stmt.m:
compiler/mode_errors.m:
compiler/mode_info.m:
compiler/modecheck_util.m:
compiler/module_qual.collect_mq_info.m:
compiler/module_qual.qualify_items.m:
compiler/parse_item.m:
compiler/parse_module.m:
compiler/parse_type_repn.m:
compiler/polymorphism.m:
compiler/post_typecheck.m:
compiler/pre_quantification.m:
compiler/pred_table.m:
compiler/prog_item.m:
compiler/recompilation.version.m:
compiler/term_constr_build.m:
compiler/termination.m:
compiler/type_ctor_info.m:
compiler/typecheck.m:
compiler/typecheck_errors.m:
compiler/typecheck_info.m:
compiler/unify_gen_construct.m:
compiler/unused_imports.m:
    Conform to the changes above. Where I am pretty sure that in an error
    message, the module qualifier of a name must be the current module,
    use unqual_pf_sym_name_orig_arity instead of qual_pf_sym_name_orig_arity.

    Add some sanity checks where they seem appropriate.

    Replace sequences of io.write_strings with uses of io.format where this
    yields clearer code. (This is why there were no remaining calls to
    write_simple_call_id.)

    Shorten some too-long lines.

    In add_pred.m, make the order of some predicate definitions match
    the order of the calls to them.

tests/invalid/ambiguous_method.err_exp:
tests/invalid/ambiguous_method_2.err_exp:
tests/invalid/bad_pred_arity.err_exp:
tests/invalid/bad_sv_unify_msg.err_exp:
tests/invalid/bigtest.err_exp:
tests/invalid/bug113.err_exp:
tests/invalid/bug197.err_exp:
tests/invalid/bug278.err_exp:
tests/invalid/bug410.err_exp:
tests/invalid/bug476.err_exp:
tests/invalid/bug487.err_exp:
tests/invalid/complex_constraint_err.err_exp:
tests/invalid/constrained_poly_insts.err_exp:
tests/invalid/errors.err_exp:
tests/invalid/errors1.err_exp:
tests/invalid/errors2.err_exp:
tests/invalid/exported_mode.err_exp:
tests/invalid/field_syntax_error.err_exp:
tests/invalid/foreign_singleton.err_exp:
tests/invalid/funcs_as_preds.err_exp:
tests/invalid/imported_mode.err_exp:
tests/invalid/invalid_binary_literal.err_exp:
tests/invalid/invalid_float_literal.err_exp:
tests/invalid/invalid_hex_literal.err_exp:
tests/invalid/invalid_octal_literal.err_exp:
tests/invalid/make_opt_error.err_exp:
tests/invalid/missing_det_decls.err_exp:
tests/invalid/multimode_syntax.err_exp:
tests/invalid/null_char.err_exp:
tests/invalid/occurs.err_exp:
tests/invalid/record_syntax_errors.err_exp:
tests/invalid/ref_to_implicit_pred.err_exp:
tests/invalid/require_tailrec_1.err_exp:
tests/invalid/require_tailrec_1.err_exp2:
tests/invalid/require_tailrec_2.err_exp:
tests/invalid/require_tailrec_2.err_exp2:
tests/invalid/require_tailrec_3.err_exp:
tests/invalid/require_tailrec_3.err_exp2:
tests/invalid/state_vars_test2.err_exp:
tests/invalid/state_vars_test3.err_exp:
tests/invalid/state_vars_test5.err_exp:
tests/invalid/type_inf_loop.err_exp:
tests/invalid/typeclass_constraint_extra_var.err_exp:
tests/invalid/typeclass_mode_2.err_exp:
tests/invalid/typeclass_test_12.err_exp:
tests/invalid/typeclass_test_2.err_exp:
tests/invalid/typeclass_test_9.err_exp:
tests/invalid/types.err_exp:
tests/invalid/types2.err_exp:
tests/invalid/unbound_type_vars.err_exp:
tests/invalid/with_type.err_exp:
tests/invalid_purity/purity_nonsense.err_exp:
tests/invalid_purity/purity_nonsense2.err_exp:
tests/warnings/double_underscore.exp:
tests/warnings/pragma_source_file.exp:
tests/warnings/singleton_test.exp:
tests/warnings/singleton_test.exp2:
tests/warnings/singleton_test.exp3:
tests/warnings/singleton_test.exp4:
tests/warnings/singleton_test_state_var.exp:
tests/warnings/warn_return.exp:
tests/warnings/warn_return.exp2:
tests/warnings/warn_return.exp3:
tests/warnings/warn_succ_ind.exp:
tests/warnings/warn_succ_ind.exp2:
tests/warnings/warn_succ_ind.exp3:
tests/warnings/warn_succ_ind.exp4:
    Update all these expected output files. Most changes are due to
    predicate and function names no longer being module qualified when
    the module qualification is obvious. A few changes are due to the
    change in the relative ordering of the function symbols of the
    format_component type.

    For singleton_test, warn_return and warn_succ_ind in warnings,
    the changes to the non-C .exp files were done by hand, so they
    may have the wrong white space.
2020-03-16 12:10:28 +11:00

140 lines
6.4 KiB
Plaintext

errors2.m:005: Warning: the interface of module `errors2' does not export
errors2.m:005: anything.
errors2.m:005: To be useful, a module should export something. A file should
errors2.m:005: contain at least one declaration other than `:- import_module'
errors2.m:005: in its interface section(s). This would normally be a
errors2.m:005: `:- pred', `:- func', `:- type', `:- inst' or `:- mode'
errors2.m:005: declaration.
errors2.m:009: Error: module `errors2' should start with either an
errors2.m:009: `:- interface' or an `:- implementation' declaration.
errors2.m:009: The following assumes that the missing declaration is an
errors2.m:009: `:- implementation' declaration.
errors2.m:009: Error: no clauses for predicate `bind_type_param'/2.
errors2.m:011: Error: clause for predicate `bind_type_param'/1
errors2.m:011: without corresponding `:- pred' declaration.
errors2.m:011: However, a predicate of that name does exist with arity 2.
errors2.m:011: Inferred :- pred bind_type_param(int).
errors2.m:011: The argument list difference from the arity 2 version is
errors2.m:011: pred(
errors2.m:011: - V_1,
errors2.m:011: - V_2
errors2.m:011: + int
errors2.m:011: )
errors2.m:025: Error: no clauses for predicate `produce_string'/1.
errors2.m:027: Error: no clauses for predicate `expect_int'/1.
errors2.m:033: In clause for predicate `type_error'/0:
errors2.m:033: in argument 1 of call to predicate `errors2.expect_int'/1:
errors2.m:033: type error: variable `X' has type `string',
errors2.m:033: expected type was `int'.
errors2.m:033: The partial type assignment was:
errors2.m:033: X_1: string
errors2.m:039: In clause for predicate `type_error_2'/0:
errors2.m:039: type error in unification of variable `X'
errors2.m:039: and variable `Y'.
errors2.m:039: `X' has type `string',
errors2.m:039: `Y' has type `int'.
errors2.m:039: The partial type assignment was:
errors2.m:039: X_1: string
errors2.m:039: Y_2: int
errors2.m:045: In clause for predicate `type_error_3'/0:
errors2.m:045: in argument 1 of call to predicate `errors2.expect_int'/1:
errors2.m:045: type error: variable `Y' has type `string',
errors2.m:045: expected type was `int'.
errors2.m:045: The partial type assignment was:
errors2.m:045: X_1: string
errors2.m:045: Y_2: string
errors2.m:054: In clause for predicate `type_error_4'/0:
errors2.m:054: warning: variable `X' occurs only once in this scope.
errors2.m:054: In clause for predicate `type_error_4'/0:
errors2.m:054: in argument 3 of functor `foo_functor/3':
errors2.m:054: type error in unification of argument
errors2.m:054: and constant `1.0'.
errors2.m:054: argument has type `string',
errors2.m:054: constant `1.0' has type `float'.
errors2.m:054: The partial type assignment was:
errors2.m:054: Y_1: int
errors2.m:054: X_2: errors2.foo_type
errors2.m:054: V_3: character
errors2.m:054: V_4: string
errors2.m:061: In clause for predicate `type_error_5'/0:
errors2.m:061: warning: variable `X' occurs only once in this scope.
errors2.m:061: In clause for predicate `type_error_5'/0:
errors2.m:061: in argument 3 of functor `foo_functor/3':
errors2.m:061: type error in unification of argument
errors2.m:061: and constant `1.0'.
errors2.m:061: argument has type `string',
errors2.m:061: constant `1.0' has type `float'.
errors2.m:061: The partial type assignment was:
errors2.m:061: Y_1: character
errors2.m:061: X_2: errors2.foo_type
errors2.m:061: V_3: int
errors2.m:061: V_4: string
errors2.m:067: In clause for predicate `type_error_6'/0:
errors2.m:067: warning: variable `X' occurs only once in this scope.
errors2.m:067: In clause for predicate `type_error_6'/0:
errors2.m:067: in argument 3 of functor `bar_functor/3':
errors2.m:067: type error in unification of argument
errors2.m:067: and constant `1.0'.
errors2.m:067: argument has type `string',
errors2.m:067: constant `1.0' has type `float'.
errors2.m:067: The partial type assignment was:
errors2.m:067: Y_1: character
errors2.m:067: X_2: errors2.bar_1_type
errors2.m:067: V_3: int
errors2.m:067: V_4: string
errors2.m:072: In clause for predicate `type_error_7'/0:
errors2.m:072: warning: variable `Y' occurs only once in this scope.
errors2.m:073: In clause for predicate `type_error_7'/0:
errors2.m:073: warning: variables `A, B, Z' occur only once in this scope.
errors2.m:074: In clause for predicate `type_error_7'/0:
errors2.m:074: in argument 1 of call to predicate `errors2.expect_int'/1:
errors2.m:074: type error: variable `C' has type `string',
errors2.m:074: expected type was `int'.
errors2.m:074: The possible partial type assignments were:
errors2.m:074: Type assignment 1:
errors2.m:074: Y_1: errors2.foo
errors2.m:074: Z_2: errors2.bar_1_type
errors2.m:074: A_3: int
errors2.m:074: B_4: character
errors2.m:074: C_5: string
errors2.m:074:
errors2.m:074: Type assignment 2:
errors2.m:074: Y_1: character
errors2.m:074: Z_2: errors2.bar_1_type
errors2.m:074: A_3: int
errors2.m:074: B_4: character
errors2.m:074: C_5: string
errors2.m:074:
errors2.m:074: Type assignment 3:
errors2.m:074: Y_1: errors2.foo
errors2.m:074: Z_2: errors2.bar_2_type
errors2.m:074: A_3: character
errors2.m:074: B_4: int
errors2.m:074: C_5: string
errors2.m:074:
errors2.m:074: Type assignment 4:
errors2.m:074: Y_1: character
errors2.m:074: Z_2: errors2.bar_2_type
errors2.m:074: A_3: character
errors2.m:074: B_4: int
errors2.m:074: C_5: string
errors2.m:080: In clause for predicate `type_error_8'/0:
errors2.m:080: error: undefined predicate `from_char_list'/2.
errors2.m:080: In clause for predicate `type_error_8'/0:
errors2.m:080: in argument 1 of call to predicate `from_char_list'/2:
errors2.m:080: error: undefined symbol `[]'/0.
errors2.m:087: In clause for predicate `type_error_9'/0:
errors2.m:087: type error in unification of variable `X'
errors2.m:087: and variable `Y'.
errors2.m:087: `X' has type `{int, string, character}',
errors2.m:087: `Y' has type `{string, character, int}'.
errors2.m:087: The partial type assignment was:
errors2.m:087: X_1: {int, string, character}
errors2.m:087: Y_2: {string, character, int}
errors2.m:087: V_3: int
errors2.m:087: V_4: string
errors2.m:087: V_5: character
errors2.m:087: V_6: string
errors2.m:087: V_7: character
errors2.m:087: V_8: int