Files
mercury/tests/invalid/bind_in_negated.err_exp
Zoltan Somogyi f4ad6de055 Generate more readable mode errors.
compiler/mode_errors.m:
    When printing insts in error messages, use predicates specifically
    designed for that purpose.

    The insts output by these predicates improve on the existing output
    in the following ways.

    - We now show the structure of complex insts through indentation.

    - We now show both the name of named insts, and their expansion.
      Sometimes, you need the expanded inst to understand the error message,
      in the case of recursive insts, you cannot expand them forever.
      Since the expansion *has* to refer to the inst name, showing that name
      at the *start* of the expansion is necessary to allow readers to
      understand the inst.

    - We now eliminate the module qualification from the names of function
      symbols. The module qualifiers on function symbols are specified
      by the type, not the inst, of the relevant term, and if we get to
      the point of mode analysis having been run, then the predicate
      we are generating errors for must be *type* correct, though obviously
      it is not *mode* correct.

    - We now eliminate the module qualification from names of named insts
      if the module qualifier is the name of the module being compiled.
      This is a common case, and in these cases, the module qualifier
      in the error message acts as clutter, making it *harder* to read.

    - We now avoid printing parentheses that humans never need, but which
      the parser sometimes does, and which the existing inst output predicates
      therefore had to print.

    - Higher order insts contain the modes of the function or predicate.
      We now print the builtin modes as e.g. "in" instead of the old
      "free >> ground".

compiler/error_util.m:
    Add some utility predicates now needed by mode_errors.m.

tests/invalid/any_passed_as_ground.err_exp2:
tests/invalid/anys_in_negated_contexts.err_exp:
tests/invalid/bind_in_negated.err_exp:
tests/invalid/bug117.err_exp:
tests/invalid/bug191.err_exp:
tests/invalid/constrained_poly_insts.err_exp:
tests/invalid/constrained_poly_insts2.err_exp:
tests/invalid/ho_any_inst.err_exp:
tests/invalid/ho_default_func_1.err_exp:
tests/invalid/ho_default_func_2.sub.err_exp:
tests/invalid/ho_default_func_3.err_exp:
tests/invalid/ho_default_func_4.err_exp:
tests/invalid/ho_type_mode_bug.err_exp:
tests/invalid/merge_ground_any.err_exp:
tests/invalid/merge_inst_error.err_exp:
tests/invalid/multimode_dcg.err_exp:
tests/invalid/occurs.err_exp:
tests/invalid/partial_implied_mode.err_exp:
tests/invalid/polymorphic_unification.err_exp:
tests/invalid/qualified_cons_id2.err_exp:
tests/invalid/state_vars_test4.err_exp:
tests/invalid/try_detism.err_exp2:
tests/warnings/unify_f_g.exp:
    Update expected outputs.
2015-11-29 04:33:41 +11:00

12 lines
736 B
Plaintext

bind_in_negated.m:019: In clause for `p((bound(f(free, ground)) >> ground),
bind_in_negated.m:019: (bound(f(ground, free)) >> ground), out)':
bind_in_negated.m:019: scope error: attempt to bind a non-local variable
bind_in_negated.m:019: inside the condition of an if-then-else.
bind_in_negated.m:019: Variable `A' has instantiatedness
bind_in_negated.m:019: `bound(f(free, ground))',
bind_in_negated.m:019: expected instantiatedness was
bind_in_negated.m:019: `bound(f(ground, ground))'.
bind_in_negated.m:019: The condition of an if-then-else is only allowed to
bind_in_negated.m:019: bind variables which are local to the condition or
bind_in_negated.m:019: which occur only in the condition and the `then' part.