Files
mercury/tests/invalid/require_scopes.err_exp
Zoltan Somogyi 590b34cfac Fix some minor problems in reporting determinism errors.
compiler/det_report.m:
    When a goal has too many solutions, but it occurs in a context in which
    the identity of those solutions does not matter, the compiler inserts
    a commit scope to prune away the redundant (because they are externally
    indistinguishable) solutions.

    When this goal is a switch inside a require_switch_arms_<detism> scope,
    this commit scope added by determinism analysis screwed up the expectation
    of the require_switch_arms_<detism> scope that the switch is its IMMEDIATE
    subgoal. Relax this sometimes-wrong assumption by allowing for a commit
    scope wrapped around the switch.

    When generating error messages for cons_ids missing from switches,
    don't print the module qualifiers for the cons_ids, since users
    will already know it (it is part of the identity of the type of switch-on
    variable).

    Print the missing cons_ids one per line, to make the list easier to read.

    Fix capitalization in some error messages.

compiler/switch_detection.m:
    When creating switch arms, give each arm a more meaningful context
    that the context of the original disjunction, which is usually the context
    of the first ";" operator in it.

tests/invalid/switch_arm_multi_not_det.{m,err_exp}:
    New test case for the fix listed first for det_report.m.

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

tests/debugger/dice.exp*:
tests/invalid/det_errors.err_exp:
tests/invalid/require_scopes.err_exp:
    Update these expected outputs for the changes above.
2016-05-13 05:48:47 +10:00

19 lines
1.2 KiB
Plaintext

require_scopes.m:036: Error: the required determinism of the goal in this scope
require_scopes.m:036: is `det', but its actual determinism is `semidet'.
require_scopes.m:037: Call to `int.>'(in, in) can fail.
require_scopes.m:040: Error: the required determinism of the goal in this scope
require_scopes.m:040: is `nondet', but its actual determinism is `semidet'.
require_scopes.m:064: Error: the switch on `A' is required to be complete, but
require_scopes.m:064: it does not cover
require_scopes.m:064: `f1'/0.
require_scopes.m:097: Error: the arms of the switch on A are required have a
require_scopes.m:097: determinism that is acceptable in a `det' context, but
require_scopes.m:097: the actual determinism of the arm for
require_scopes.m:097: require_scopes.f3/1 is `semidet'.
require_scopes.m:098: Call to `int.>'(in, in) can fail.
require_scopes.m:109: Error: the arms of the switch on B are required have a
require_scopes.m:109: determinism that is acceptable in a `semidet' context,
require_scopes.m:109: but the actual determinism of the arm for 10 is
require_scopes.m:109: `multi'.
require_scopes.m:111: Disjunction has multiple clauses with solutions.