mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-29 16:24:43 +00:00
compiler/parse_module.m:
When complaining about missing ":- interface"/":- implementation" markers,
reword the diagnostic to clarify that these should come after
the initial ":- module" declaration.
tests/invalid_make_int/missing_initial_section.int_err_exp:
tests/invalid_nodepend/bigtest.err_exp:
tests/invalid_nodepend/errors_1.err_exp:
tests/invalid_nodepend/errors_2.err_exp:
tests/invalid_nodepend/errors_3.err_exp:
tests/invalid_nodepend/funcs_as_preds.err_exp:
tests/invalid_nodepend/invalid_main.err_exp:
tests/invalid_nodepend/no_exports.err_exp:
tests/invalid_nodepend/occurs.err_exp:
tests/invalid_nodepend/prog_io_erroneous.err_exp:
tests/invalid_nodepend/types.err_exp:
tests/invalid_nodepend/vars_in_wrong_places.err_exp:
Expect the updated wording.
167 lines
8.9 KiB
Plaintext
167 lines
8.9 KiB
Plaintext
errors_2.m:005: Warning: the interface of module [38;5;87m`errors_2'[39;49m [38;5;203mdoes not export[39;49m
|
||
errors_2.m:005: [38;5;203manything.[39;49m
|
||
errors_2.m:005: To be useful, a module should export something. A file should
|
||
errors_2.m:005: contain at least one declaration other than
|
||
errors_2.m:005: `:- import_module' in its interface section(s). This would
|
||
errors_2.m:005: normally be a `:- pred' or `:- func' declaration, or a
|
||
errors_2.m:005: `:- type', `:- inst', `:- mode', `:- typeclass' or
|
||
errors_2.m:005: `:- instance' definition.
|
||
errors_2.m:009: Error: the contents of module `errors_2' after the `:- module'
|
||
errors_2.m:009: declaration [38;5;203mshould start with[39;49m either an [38;5;40m`:- interface'[39;49m
|
||
errors_2.m:009: [38;5;40mdeclaration[39;49m or an [38;5;40m`:- implementation' declaration.[39;49m
|
||
errors_2.m:009: The following assumes that the missing declaration is an
|
||
errors_2.m:009: `:- implementation' declaration.
|
||
errors_2.m:009: Error: predicate [38;5;87m`bind_type_param'/2[39;49m [38;5;203mhas no clauses.[39;49m
|
||
errors_2.m:011: Error: clause for predicate [38;5;87m`bind_type_param'/1[39;49m [38;5;203mwithout[39;49m a
|
||
errors_2.m:011: corresponding `:- pred' declaration.
|
||
errors_2.m:011: However, a predicate of that name does exist with arity [38;5;40m2.[39;49m
|
||
errors_2.m:011: Inferred :- pred bind_type_param(int).
|
||
errors_2.m:011: The argument list difference from the arity 2 version is
|
||
errors_2.m:011: pred(
|
||
errors_2.m:011: [38;5;40m- V_1,[39;49m
|
||
errors_2.m:011: [38;5;40m- V_2[39;49m
|
||
errors_2.m:011: [38;5;203m+ int[39;49m
|
||
errors_2.m:011: )
|
||
errors_2.m:025: Error: predicate [38;5;87m`produce_string'/1[39;49m [38;5;203mhas no clauses.[39;49m
|
||
errors_2.m:027: Error: predicate [38;5;87m`expect_int'/1[39;49m [38;5;203mhas no clauses.[39;49m
|
||
errors_2.m:033: In clause for predicate `type_error'/0:
|
||
errors_2.m:033: in argument 1 of call to predicate `errors_2.expect_int'/1:
|
||
errors_2.m:033: type error: [38;5;87mvariable `X'[39;49m has type
|
||
errors_2.m:033: [38;5;203mstring;[39;49m
|
||
errors_2.m:033: expected type was
|
||
errors_2.m:033: [38;5;40mint.[39;49m
|
||
errors_2.m:033: The partial type assignment was:
|
||
errors_2.m:033: X_1: string
|
||
errors_2.m:040: In clause for predicate `type_error_2'/0:
|
||
errors_2.m:040: type error in unification of variable `X' and variable `Y'.
|
||
errors_2.m:040: [38;5;87m`X'[39;49m has type
|
||
errors_2.m:040: [38;5;171mstring,[39;49m
|
||
errors_2.m:040: [38;5;87m`Y'[39;49m has type
|
||
errors_2.m:040: [38;5;171mint.[39;49m
|
||
errors_2.m:040: The partial type assignment was:
|
||
errors_2.m:040: X_1: string
|
||
errors_2.m:040: Y_2: int
|
||
errors_2.m:047: In clause for predicate `type_error_3'/0:
|
||
errors_2.m:047: in argument 1 of call to predicate `errors_2.expect_int'/1:
|
||
errors_2.m:047: type error: [38;5;87mvariable `Y'[39;49m has type
|
||
errors_2.m:047: [38;5;203mstring;[39;49m
|
||
errors_2.m:047: expected type was
|
||
errors_2.m:047: [38;5;40mint.[39;49m
|
||
errors_2.m:047: The partial type assignment was:
|
||
errors_2.m:047: X_1: string
|
||
errors_2.m:047: Y_2: string
|
||
errors_2.m:062: In clause for predicate `type_error_4'/0:
|
||
errors_2.m:062: warning: variable [38;5;87m`X'[39;49m [38;5;203moccurs only once[39;49m in this scope.
|
||
errors_2.m:062: In clause for predicate `type_error_4'/0:
|
||
errors_2.m:062: type error in unification of argument 3 of functor
|
||
errors_2.m:062: `foo_functor/3'
|
||
errors_2.m:062: and constant `1.0'.
|
||
errors_2.m:062: [38;5;87mArgument 3 of functor `foo_functor/3'[39;49m has type
|
||
errors_2.m:062: [38;5;203mstring,[39;49m
|
||
errors_2.m:062: [38;5;87mconstant `1.0'[39;49m has type
|
||
errors_2.m:062: [38;5;40mfloat.[39;49m
|
||
errors_2.m:062: The partial type assignment was:
|
||
errors_2.m:062: Y_1: int
|
||
errors_2.m:062: X_2: errors_2.foo_type
|
||
errors_2.m:062: V_3: character
|
||
errors_2.m:062: V_4: string
|
||
errors_2.m:072: In clause for predicate `type_error_5'/0:
|
||
errors_2.m:072: warning: variable [38;5;87m`X'[39;49m [38;5;203moccurs only once[39;49m in this scope.
|
||
errors_2.m:072: In clause for predicate `type_error_5'/0:
|
||
errors_2.m:072: type error in unification of argument 3 of functor
|
||
errors_2.m:072: `foo_functor/3'
|
||
errors_2.m:072: and constant `1.0'.
|
||
errors_2.m:072: [38;5;87mArgument 3 of functor `foo_functor/3'[39;49m has type
|
||
errors_2.m:072: [38;5;203mstring,[39;49m
|
||
errors_2.m:072: [38;5;87mconstant `1.0'[39;49m has type
|
||
errors_2.m:072: [38;5;40mfloat.[39;49m
|
||
errors_2.m:072: The partial type assignment was:
|
||
errors_2.m:072: Y_1: character
|
||
errors_2.m:072: X_2: errors_2.foo_type
|
||
errors_2.m:072: V_3: int
|
||
errors_2.m:072: V_4: string
|
||
errors_2.m:078: In clause for predicate `type_error_6'/0:
|
||
errors_2.m:078: warning: variable [38;5;87m`X'[39;49m [38;5;203moccurs only once[39;49m in this scope.
|
||
errors_2.m:078: In clause for predicate `type_error_6'/0:
|
||
errors_2.m:078: type error in unification of argument 3 of functor
|
||
errors_2.m:078: `bar_functor/3'
|
||
errors_2.m:078: and constant `1.0'.
|
||
errors_2.m:078: [38;5;87mArgument 3 of functor `bar_functor/3'[39;49m has type
|
||
errors_2.m:078: [38;5;203mstring,[39;49m
|
||
errors_2.m:078: [38;5;87mconstant `1.0'[39;49m has type
|
||
errors_2.m:078: [38;5;40mfloat.[39;49m
|
||
errors_2.m:078: The partial type assignment was:
|
||
errors_2.m:078: Y_1: character
|
||
errors_2.m:078: X_2: errors_2.bar_1_type
|
||
errors_2.m:078: V_3: int
|
||
errors_2.m:078: V_4: string
|
||
errors_2.m:083: In clause for predicate `type_error_7'/0:
|
||
errors_2.m:083: warning: variable [38;5;87m`Y'[39;49m [38;5;203moccurs only once[39;49m in this scope.
|
||
errors_2.m:084: In clause for predicate `type_error_7'/0:
|
||
errors_2.m:084: warning: variables [38;5;87m`A',[39;49m [38;5;87m`B'[39;49m and [38;5;87m`Z'[39;49m [38;5;203moccur only once[39;49m in this
|
||
errors_2.m:084: scope.
|
||
errors_2.m:085: In clause for predicate `type_error_7'/0:
|
||
errors_2.m:085: in argument 1 of call to predicate `errors_2.expect_int'/1:
|
||
errors_2.m:085: type error: [38;5;87mvariable `C'[39;49m has type
|
||
errors_2.m:085: [38;5;203mstring;[39;49m
|
||
errors_2.m:085: expected type was
|
||
errors_2.m:085: [38;5;40mint.[39;49m
|
||
errors_2.m:085: The possible partial type assignments were:
|
||
errors_2.m:085: Type assignment 1:
|
||
errors_2.m:085: Y_1: errors_2.foo
|
||
errors_2.m:085: Z_2: errors_2.bar_1_type
|
||
errors_2.m:085: A_3: int
|
||
errors_2.m:085: B_4: character
|
||
errors_2.m:085: C_5: string
|
||
errors_2.m:085:
|
||
errors_2.m:085: Type assignment 2:
|
||
errors_2.m:085: Y_1: character
|
||
errors_2.m:085: Z_2: errors_2.bar_1_type
|
||
errors_2.m:085: A_3: int
|
||
errors_2.m:085: B_4: character
|
||
errors_2.m:085: C_5: string
|
||
errors_2.m:085:
|
||
errors_2.m:085: Type assignment 3:
|
||
errors_2.m:085: Y_1: errors_2.foo
|
||
errors_2.m:085: Z_2: errors_2.bar_2_type
|
||
errors_2.m:085: A_3: character
|
||
errors_2.m:085: B_4: int
|
||
errors_2.m:085: C_5: string
|
||
errors_2.m:085:
|
||
errors_2.m:085: Type assignment 4:
|
||
errors_2.m:085: Y_1: character
|
||
errors_2.m:085: Z_2: errors_2.bar_2_type
|
||
errors_2.m:085: A_3: character
|
||
errors_2.m:085: B_4: int
|
||
errors_2.m:085: C_5: string
|
||
errors_2.m:087: Warning: this [38;5;87m`:- use_module' declaration for module `string'[39;49m
|
||
errors_2.m:087: [38;5;203mis on the same line[39;49m as the preceding `:- use_module'
|
||
errors_2.m:087: declaration for module `list'.
|
||
errors_2.m:092: In clause for predicate `type_error_8'/0:
|
||
errors_2.m:092: error: call to [38;5;203mundefined[39;49m predicate [38;5;87m`from_char_list'/2.[39;49m
|
||
errors_2.m:092: That predicate is defined in module [38;5;87m`string',[39;49m [38;5;226mwhich does not[39;49m
|
||
errors_2.m:092: [38;5;226mhave an `:- import_module' declaration.[39;49m
|
||
errors_2.m:092: Note that symbols defined in modules accessed via
|
||
errors_2.m:092: `:- use_module' declarations must always be fully module
|
||
errors_2.m:092: qualified.
|
||
errors_2.m:092: In clause for predicate `type_error_8'/0:
|
||
errors_2.m:092: in argument 1 of call to predicate `from_char_list'/2:
|
||
errors_2.m:092: error: [38;5;203mundefined[39;49m symbol [38;5;87m`[]'/0.[39;49m
|
||
errors_2.m:092: That symbol is defined in module [38;5;87m`list',[39;49m [38;5;226mwhich does not have[39;49m
|
||
errors_2.m:092: [38;5;226man `:- import_module' declaration.[39;49m
|
||
errors_2.m:100: In clause for predicate `type_error_9'/0:
|
||
errors_2.m:100: type error in unification of variable `X' and variable `Y'.
|
||
errors_2.m:100: [38;5;87m`X'[39;49m has type
|
||
errors_2.m:100: [38;5;171m{int, string, character},[39;49m
|
||
errors_2.m:100: [38;5;87m`Y'[39;49m has type
|
||
errors_2.m:100: [38;5;171m{string, character, int}.[39;49m
|
||
errors_2.m:100: The partial type assignment was:
|
||
errors_2.m:100: X_1: {int, string, character}
|
||
errors_2.m:100: Y_2: {string, character, int}
|
||
errors_2.m:100: V_3: int
|
||
errors_2.m:100: V_4: string
|
||
errors_2.m:100: V_5: character
|
||
errors_2.m:100: V_6: string
|
||
errors_2.m:100: V_7: character
|
||
errors_2.m:100: V_8: int
|