mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-22 04:43:53 +00:00
compiler/det_check_goal.m:
When reporting that a disjunction has more than one disjunct
that can succeed (which is an error if the disjunction is supposed
to be e.g. det or semidet), if the disjunct is actually a whole clause
in the source code, then mention that fact.
compiler/hlds_markers.m:
Define a goal feature that, when present, says "this goal used to be
a whole clause".
compiler/clause_to_proc.m:
Set this feature on clauses that we turn into disjuncts.
Make the predicate involved tail recursive.
compiler/saved_vars.m:
Conform to the change in hlds_markers.m.
tests/invalid/accidental_clause.{m,err_exp}:
Add this test case, which is a much-simplified version of the code
from an old post on m-users that motivated this change.
tests/invalid/Mmakefile:
Enable the new test case.
tests/invalid/not_a_switch.err_exp:
Expect the updated form of this diagnostic.
997 B
997 B
not_a_switch.m:014: Error: the determinism declaration for predicate
not_a_switch.m:014: `not_a_switch'/2 is not satisfied.
not_a_switch.m:014: Declared `det', inferred `nondet'.
not_a_switch.m:014: The reasons for the difference are the following.
not_a_switch.m:019:
not_a_switch.m:019: Disjunction consisting of several clauses has more than
not_a_switch.m:019: one disjunct with solutions.
not_a_switch.m:022:
not_a_switch.m:022: This later disjunct, which is a whole clause, may have a
not_a_switch.m:022: solution.
not_a_switch.m:021:
not_a_switch.m:021: Unification of `A' and `maybe.yes(Int2)' can fail.
not_a_switch.m:022:
not_a_switch.m:022: In argument 1 of clause head:
not_a_switch.m:022: unification of `HeadVar__1' and `maybe.no' can fail.
not_a_switch.m:014: `not_a_switch'/2 is not satisfied.
not_a_switch.m:014: Declared `det', inferred `nondet'.
not_a_switch.m:014: The reasons for the difference are the following.
not_a_switch.m:019:
not_a_switch.m:019: Disjunction consisting of several clauses has more than
not_a_switch.m:019: one disjunct with solutions.
not_a_switch.m:022:
not_a_switch.m:022: This later disjunct, which is a whole clause, may have a
not_a_switch.m:022: solution.
not_a_switch.m:021:
not_a_switch.m:021: Unification of `A' and `maybe.yes(Int2)' can fail.
not_a_switch.m:022:
not_a_switch.m:022: In argument 1 of clause head:
not_a_switch.m:022: unification of `HeadVar__1' and `maybe.no' can fail.