Files
mercury/tests/invalid/multimode_syntax.err_exp
Zoltan Somogyi 2bf3432804 Better diagnostics for bad use of language constructs.
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.
2025-01-05 16:33:00 +11:00

4.2 KiB

multimode_syntax.m:015: Error: function `func0'/0 has no clauses.
multimode_syntax.m:017: Error: clause for predicate `::'/2 without 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 `='/2 should be used as
multimode_syntax.m:017: part of a goal, not as an expression.
multimode_syntax.m:017: In clause for predicate `::'/2:
multimode_syntax.m:017: in argument 2 of clause head:
multimode_syntax.m:017: error: undefined symbol `out'/0.
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: some but not all arguments have mode
multimode_syntax.m:022: annotations. The argument without a mode is the
multimode_syntax.m:022: second.
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: some but not all arguments have mode
multimode_syntax.m:023: annotations. The argument without a mode is the
multimode_syntax.m:023: first.
multimode_syntax.m:027: Warning: the function `func2'/2 has only one mode, so
multimode_syntax.m:027: there is no need to restrict a clause for it to that
multimode_syntax.m:027: mode.
multimode_syntax.m:029: In clause for function `func2'/2:
multimode_syntax.m:029: error: mode annotation specifies undeclared mode
multimode_syntax.m:029: `func2(in, out) = out'.
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 `func2'/2:
multimode_syntax.m:031: error: mode annotation specifies undeclared mode
multimode_syntax.m:031: `func2(out, in) = out'.
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 `func2'/2:
multimode_syntax.m:033: error: mode annotation specifies undeclared mode
multimode_syntax.m:033: `func2(out, out) = out'.
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 `func2b'/2:
multimode_syntax.m:037: error: mode annotation specifies undeclared mode
multimode_syntax.m:037: `func2b(in, out) = out'.
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 `pred2b'/2:
multimode_syntax.m:041: error: mode annotation specifies undeclared mode
multimode_syntax.m:041: `pred2b(in, out)'.
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: some but not all arguments have mode
multimode_syntax.m:049: annotations. The argument without a mode is the
multimode_syntax.m:049: second.
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: some but not all arguments have mode
multimode_syntax.m:051: annotations. The argument without a mode is the
multimode_syntax.m:051: first.