mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
compiler/typecheck_error_unify.m:
As above.
compiler/hlds_error_util.m:
compiler/typecheck_error_util.m:
Export operations that are now needed by typecheck_error_unify.m.
To make this possible, carve some of those operations out of
other operations.
tests/invalid/ho_type_arity_bug.err_exp:
tests/invalid/missing_closure_arg.err_exp:
tests/invalid/nullary_ho_func_error.err_exp:
tests/invalid_nodepend/errors_2.err_exp:
tests/invalid_purity/impure_func_t5.err_exp:
tests/invalid_purity/impure_pred_t1.err_exp:
Expect the updated diagnostics.
8.9 KiB
8.9 KiB
errors_2.m:005: Warning: the interface of module `errors_2' does not export
errors_2.m:005: anything.
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: module `errors_2' should start with either an
errors_2.m:009: `:- interface' declaration or an `:- implementation'
errors_2.m:009: declaration.
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 `bind_type_param'/2 has no clauses.
errors_2.m:011: Error: clause for predicate `bind_type_param'/1 without a
errors_2.m:011: corresponding `:- pred' declaration.
errors_2.m:011: However, a predicate of that name does exist with arity 2.
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: - V_1,
errors_2.m:011: - V_2
errors_2.m:011: + int
errors_2.m:011: )
errors_2.m:025: Error: predicate `produce_string'/1 has no clauses.
errors_2.m:027: Error: predicate `expect_int'/1 has no clauses.
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: variable `X' has type
errors_2.m:033: string;
errors_2.m:033: expected type was
errors_2.m:033: int.
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: `X' has type
errors_2.m:040: string,
errors_2.m:040: `Y' has type
errors_2.m:040: int.
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: variable `Y' has type
errors_2.m:047: string;
errors_2.m:047: expected type was
errors_2.m:047: int.
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 `X' occurs only once 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: Argument 3 of functor `foo_functor/3' has type
errors_2.m:062: string,
errors_2.m:062: constant `1.0' has type
errors_2.m:062: float.
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 `X' occurs only once 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: Argument 3 of functor `foo_functor/3' has type
errors_2.m:072: string,
errors_2.m:072: constant `1.0' has type
errors_2.m:072: float.
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 `X' occurs only once 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: Argument 3 of functor `bar_functor/3' has type
errors_2.m:078: string,
errors_2.m:078: constant `1.0' has type
errors_2.m:078: float.
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 `Y' occurs only once in this scope.
errors_2.m:084: In clause for predicate `type_error_7'/0:
errors_2.m:084: warning: variables `A', `B' and `Z' occur only once 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: variable `C' has type
errors_2.m:085: string;
errors_2.m:085: expected type was
errors_2.m:085: int.
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 `:- use_module' declaration for module `string'
errors_2.m:087: is on the same line 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 undefined predicate `from_char_list'/2.
errors_2.m:092: That predicate is defined in module `string', which does not
errors_2.m:092: have an `:- import_module' declaration.
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: undefined symbol `[]'/0.
errors_2.m:092: That symbol is defined in module `list', which does not have
errors_2.m:092: an `:- import_module' declaration.
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: `X' has type
errors_2.m:100: {int, string, character},
errors_2.m:100: `Y' has type
errors_2.m:100: {string, character, int}.
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
errors_2.m:005: anything.
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: module `errors_2' should start with either an
errors_2.m:009: `:- interface' declaration or an `:- implementation'
errors_2.m:009: declaration.
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 `bind_type_param'/2 has no clauses.
errors_2.m:011: Error: clause for predicate `bind_type_param'/1 without a
errors_2.m:011: corresponding `:- pred' declaration.
errors_2.m:011: However, a predicate of that name does exist with arity 2.
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: - V_1,
errors_2.m:011: - V_2
errors_2.m:011: + int
errors_2.m:011: )
errors_2.m:025: Error: predicate `produce_string'/1 has no clauses.
errors_2.m:027: Error: predicate `expect_int'/1 has no clauses.
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: variable `X' has type
errors_2.m:033: string;
errors_2.m:033: expected type was
errors_2.m:033: int.
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: `X' has type
errors_2.m:040: string,
errors_2.m:040: `Y' has type
errors_2.m:040: int.
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: variable `Y' has type
errors_2.m:047: string;
errors_2.m:047: expected type was
errors_2.m:047: int.
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 `X' occurs only once 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: Argument 3 of functor `foo_functor/3' has type
errors_2.m:062: string,
errors_2.m:062: constant `1.0' has type
errors_2.m:062: float.
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 `X' occurs only once 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: Argument 3 of functor `foo_functor/3' has type
errors_2.m:072: string,
errors_2.m:072: constant `1.0' has type
errors_2.m:072: float.
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 `X' occurs only once 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: Argument 3 of functor `bar_functor/3' has type
errors_2.m:078: string,
errors_2.m:078: constant `1.0' has type
errors_2.m:078: float.
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 `Y' occurs only once in this scope.
errors_2.m:084: In clause for predicate `type_error_7'/0:
errors_2.m:084: warning: variables `A', `B' and `Z' occur only once 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: variable `C' has type
errors_2.m:085: string;
errors_2.m:085: expected type was
errors_2.m:085: int.
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 `:- use_module' declaration for module `string'
errors_2.m:087: is on the same line 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 undefined predicate `from_char_list'/2.
errors_2.m:092: That predicate is defined in module `string', which does not
errors_2.m:092: have an `:- import_module' declaration.
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: undefined symbol `[]'/0.
errors_2.m:092: That symbol is defined in module `list', which does not have
errors_2.m:092: an `:- import_module' declaration.
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: `X' has type
errors_2.m:100: {int, string, character},
errors_2.m:100: `Y' has type
errors_2.m:100: {string, character, int}.
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