mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-23 05:13:48 +00:00
compiler/typecheck_error_type_assign.m:
Rewrite the code that outputs type assignments, which we output
as verbose-only components of some errors. The new code
- make the output easier to read by padding the var names on the
left hand side of the output as needed to make the types on the
right hand side of the output line up,
- replaces non-tail-recursive code with tail-recursive code, and
- simplifies the handling of newlines.
tests/invalid/ext_type.err_exp:
tests/invalid/illtyped_compare.err_exp:
tests/invalid/mpj_1.err_exp:
tests/invalid/mpj_4.err_exp:
tests/invalid/nullary_ho_func_error.err_exp:
tests/invalid_purity/impure_func_t5.err_exp:
tests/invalid_purity/impure_pred_t1.err_exp:
tests/invalid_purity/impure_pred_t1_fixed.err_exp:
tests/invalid_purity/impure_pred_t2.err_exp:
Expect updated diagnostics.
727 B
727 B
mpj_1.m:017: Inferred :- func f(E, E, T4) = T4 <= (mpj_1.coll(E, T4)).
mpj_1.m:019: In clause for function `g'/1:
mpj_1.m:019: in function result term of clause head:
mpj_1.m:019: in argument 2 of functor `f/3':
mpj_1.m:019: type error in unification of argument
mpj_1.m:019: and constant `2'.
mpj_1.m:019: Argument has type
mpj_1.m:019: string,
mpj_1.m:019: constant `2' has type
mpj_1.m:019: int.
mpj_1.m:019: The partial type assignment was:
mpj_1.m:019: HeadVar__2_2: T2
mpj_1.m:019: L_3: T2
mpj_1.m:019: V_4: string
mpj_1.m:019: V_5: string
mpj_1.m:019: <= mpj_1.coll(string, T2)
mpj_1.m:019: In clause for function `g'/1:
mpj_1.m:019: in function result term of clause head:
mpj_1.m:019: in argument 2 of functor `f/3':
mpj_1.m:019: type error in unification of argument
mpj_1.m:019: and constant `2'.
mpj_1.m:019: Argument has type
mpj_1.m:019: string,
mpj_1.m:019: constant `2' has type
mpj_1.m:019: int.
mpj_1.m:019: The partial type assignment was:
mpj_1.m:019: HeadVar__2_2: T2
mpj_1.m:019: L_3: T2
mpj_1.m:019: V_4: string
mpj_1.m:019: V_5: string
mpj_1.m:019: <= mpj_1.coll(string, T2)