mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-22 04:43:53 +00:00
compiler/typecheck_error_undef.m:
Stop generatic diagnostics that a language construct "should be used
as a goal, not as an expression", because exactly none of those
constructs are complete goals by themselves.
Instead, generate messages that specify that those constructs
should be
- "part of a goal", for e.g. equal signs,
- "a prefix before a goal", for e.g. "impure", or
- "a connective between goals", for e.g. ";"".
Also, address a review comment.
tests/invalid/multimode_syntax.err_exp:
tests/invalid_nodepend/funcs_as_preds.err_exp:
tests/invalid_purity/purity_nonsense_1.err_exp:
tests/invalid_purity/purity_nonsense_2.err_exp:
Expect the updated wording.
58 lines
4.2 KiB
Plaintext
58 lines
4.2 KiB
Plaintext
multimode_syntax.m:015: Error: function [38;5;87m`func0'/0[39;49m [38;5;203mhas no clauses.[39;49m
|
||
multimode_syntax.m:017: Error: clause for predicate [38;5;87m`::'/2[39;49m [38;5;203mwithout[39;49m a
|
||
multimode_syntax.m:017: corresponding `:- pred' declaration.
|
||
multimode_syntax.m:017: In clause for predicate `::'/2:
|
||
multimode_syntax.m:017: in argument 1 of clause head:
|
||
multimode_syntax.m:017: error: the language construct [38;5;87m`='/2[39;49m should be used as
|
||
multimode_syntax.m:017: [38;5;40mpart of a goal,[39;49m [38;5;203mnot as an expression.[39;49m
|
||
multimode_syntax.m:017: In clause for predicate `::'/2:
|
||
multimode_syntax.m:017: in argument 2 of clause head:
|
||
multimode_syntax.m:017: error: [38;5;203mundefined[39;49m symbol [38;5;87m`out'/0.[39;49m
|
||
multimode_syntax.m:022: In the head of a clause for
|
||
multimode_syntax.m:022: function `multimode_syntax.func1'/1:
|
||
multimode_syntax.m:022: syntax error: [38;5;203msome but not all arguments have mode[39;49m
|
||
multimode_syntax.m:022: [38;5;203mannotations.[39;49m The argument without a mode is the
|
||
multimode_syntax.m:022: [38;5;203msecond.[39;49m
|
||
multimode_syntax.m:023: In the head of a clause for
|
||
multimode_syntax.m:023: function `multimode_syntax.func1'/1:
|
||
multimode_syntax.m:023: syntax error: [38;5;203msome but not all arguments have mode[39;49m
|
||
multimode_syntax.m:023: [38;5;203mannotations.[39;49m The argument without a mode is the
|
||
multimode_syntax.m:023: [38;5;203mfirst.[39;49m
|
||
multimode_syntax.m:027: Warning: the function [38;5;87m`func2'/2[39;49m has only one mode, so
|
||
multimode_syntax.m:027: there is [38;5;203mno need to restrict a clause for it to that[39;49m
|
||
multimode_syntax.m:027: [38;5;203mmode.[39;49m
|
||
multimode_syntax.m:029: In clause for function [38;5;87m`func2'/2:[39;49m
|
||
multimode_syntax.m:029: error: mode annotation specifies [38;5;203mundeclared mode[39;49m
|
||
multimode_syntax.m:029: [38;5;203m`func2(in, out) = out'.[39;49m
|
||
multimode_syntax.m:029: The declared mode for this function is:
|
||
multimode_syntax.m:029: :- mode func2(in, in) = out is det.
|
||
multimode_syntax.m:031: In clause for function [38;5;87m`func2'/2:[39;49m
|
||
multimode_syntax.m:031: error: mode annotation specifies [38;5;203mundeclared mode[39;49m
|
||
multimode_syntax.m:031: [38;5;203m`func2(out, in) = out'.[39;49m
|
||
multimode_syntax.m:031: The declared mode for this function is:
|
||
multimode_syntax.m:031: :- mode func2(in, in) = out is det.
|
||
multimode_syntax.m:033: In clause for function [38;5;87m`func2'/2:[39;49m
|
||
multimode_syntax.m:033: error: mode annotation specifies [38;5;203mundeclared mode[39;49m
|
||
multimode_syntax.m:033: [38;5;203m`func2(out, out) = out'.[39;49m
|
||
multimode_syntax.m:033: The declared mode for this function is:
|
||
multimode_syntax.m:033: :- mode func2(in, in) = out is det.
|
||
multimode_syntax.m:037: In clause for function [38;5;87m`func2b'/2:[39;49m
|
||
multimode_syntax.m:037: error: mode annotation specifies [38;5;203mundeclared mode[39;49m
|
||
multimode_syntax.m:037: [38;5;203m`func2b(in, out) = out'.[39;49m
|
||
multimode_syntax.m:037: The declared mode for this function is:
|
||
multimode_syntax.m:037: :- mode func2b(in, in) = out is det.
|
||
multimode_syntax.m:041: In clause for predicate [38;5;87m`pred2b'/2:[39;49m
|
||
multimode_syntax.m:041: error: mode annotation specifies [38;5;203mundeclared mode[39;49m
|
||
multimode_syntax.m:041: [38;5;203m`pred2b(in, out)'.[39;49m
|
||
multimode_syntax.m:041: (There are no declared modes for this predicate.)
|
||
multimode_syntax.m:049: In the head of a clause for
|
||
multimode_syntax.m:049: predicate `multimode_syntax.test2'/2:
|
||
multimode_syntax.m:049: syntax error: [38;5;203msome but not all arguments have mode[39;49m
|
||
multimode_syntax.m:049: [38;5;203mannotations.[39;49m The argument without a mode is the
|
||
multimode_syntax.m:049: [38;5;203msecond.[39;49m
|
||
multimode_syntax.m:051: In the head of a clause for
|
||
multimode_syntax.m:051: predicate `multimode_syntax.test2'/2:
|
||
multimode_syntax.m:051: syntax error: [38;5;203msome but not all arguments have mode[39;49m
|
||
multimode_syntax.m:051: [38;5;203mannotations.[39;49m The argument without a mode is the
|
||
multimode_syntax.m:051: [38;5;203mfirst.[39;49m
|