[m-rev.] for post-commit review: print more info for Manti 585 problems

Peter Wang novalazy at gmail.com
Thu Sep 17 15:31:36 AEST 2026


On Wed, 16 Sep 2026 18:35:17 +0200 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> For review by anyone.
> 
> Zoltan.

> Print more info for 
> 
> compiler/simplify_proc.m:
>     For each constraint with different typeclass_infos in different branches,
>     report what lines of code those typeclass_infos came from.
>     (This can be a bit confusing if there is only one line, e.g. when
>     a switch arm is automatically duplicated by the compiler, but it may
>     still be helpful.)
> 
>     Improve the wording of the diagnostic.
> 
> compiler/polymorphism_type_class_info.m:
>     Add contexts to the goal_infos of the goals that construct
>     typeclass_infos, to make the above possible.
> 
> tests/invalid/tci_liveness_abort.err_exp:
>     Expect the updated info and wording.
> 
> compiler/hlds_error_util.m:
>     Delete all module qualifications from inst names in procedure
>     argument modes, since they are just clutter.
> 
> tests/warnings/unused_args_some_modes.err_exp:
>     Stop expecting module qualified inst names in procedure argument modes.
> 
> library/multi_map.m:
>     Add the to_sorted_assoc_list operation in both predicate and
>     function forms, for use by new code in simplify_proc.m.
> 
> NEWS.md:
>     Announce the new predicate and function.

> @@ -688,18 +690,15 @@ construct_typeclass_info(Constraint, BaseVar, BaseConsId, ArgVarsMCAs,
>              Unification, UnifyContext),
>  
>          % Create a goal_info for the unification.
> -        goal_info_init(GoalInfo0),
>          NonLocals = set_of_var.make_singleton(TypeClassInfoVar),
> -        goal_info_set_nonlocals(NonLocals, GoalInfo0, GoalInfo1),
>          % Note that we could perhaps be more accurate than `ground(shared)',
>          % but it shouldn't make any difference.
>          TypeClassInfoInst = bound(shared, inst_test_results_fgtc,
>              [bound_functor(ConsId, [])]),
>          TypeClassInfoVarInst = TypeClassInfoVar - TypeClassInfoInst,
>          InstMapDelta = instmap_delta_from_assoc_list([TypeClassInfoVarInst]),
> -        goal_info_set_instmap_delta(InstMapDelta, GoalInfo1, GoalInfo2),
> -        goal_info_set_determinism(detism_det, GoalInfo2, GoalInfo),
> -
> +        goal_info_init(NonLocals, InstMapDelta, detism_erroneous,
> +            purity_pure, Context, GoalInfo),
>          Goal = hlds_goal(GoalExpr, GoalInfo),
>          % XXX reset varset and vartypes
>          AllGoals = [Goal]

Why detism_erroneous?

Peter


More information about the reviews mailing list