mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-22 04:43:53 +00:00
Estimated hours taken: 0.75 Report an error if the first argument of a `some' goal is not a list of variables. compiler/prog_io.m: compiler/prog_io_util.m: Move `parse_list_of_vars' from prog_io.m to prog_io_util.m. compiler/prog_io_goal.m: Check to make sure that the first argument to a some goal is a list of variables. (If not, we don't report an error here -- the error will be reported by typecheck.m.) compiler/typecheck.m: Report an proper error message if there is a call to an undefined predicate `some/2'. Also add `some/2' and `all/2' to the list of language builtins for which we report a special error message if they occur as undefined function symbols. tests/invalid/Mmakefile: tests/invalid/some.m: tests/invalid/some.err_exp: Regression test for the above change.
15 lines
260 B
Mathematica
15 lines
260 B
Mathematica
:- module (some).
|
|
|
|
:- interface.
|
|
|
|
:- pred p1(int::in) is semidet.
|
|
:- some junk pred p2(int::in) is semidet.
|
|
:- pred p3(int::in) is semidet.
|
|
|
|
:- implementation.
|
|
:- import_module int.
|
|
|
|
p1(X) :- some junk p3(X).
|
|
p3(X) :- ( some junk X > 0 -> X = 42 ; X = -42 ).
|
|
|