[m-rev.] for post-commit review: diagnose bound inst vars

Zoltan Somogyi zoltan.somogyi at runbox.com
Thu Oct 31 12:37:56 AEDT 2024



On Thu, 31 Oct 2024 12:14:44 +1100, Peter Wang <novalazy at gmail.com> wrote:
> > +compute_pred_modecheck_arg_offset(PredInfo) = ArgOffset :-
> >      pred_info_get_orig_arity(PredInfo, pred_form_arity(PredFormArityInt)),
> >      pred_info_get_arg_types(PredInfo, ArgTypes),
> >      % Note that this is not num_extra_args; it does the subtraction
> >      % in the *other* direction.
> >      list.length(ArgTypes, CurrentArity),
> > -    ArgOffset = PredFormArityInt - CurrentArity.
> > +    ArgOffset = modecheck_arg_offset(PredFormArityInt - CurrentArity).
> > +
> > +higher_order_modecheck_arg_offset = modecheck_arg_offset(1).
> 
> Is this because a higher order call is really call(HOTerm, Arg1, ...)?

In this diff, I just copied the 1 from the code handling higher order calls,
so I don't know for sure that this is the reason. I will look into it and add a comment.

> > +
> > +unify_method_event_cast_modecheck_arg_offset = modecheck_arg_offset(0).
> >  
> >  %---------------------------------------------------------------------------%
> >  
> 
> That looks fine, otherwise.

Thanks for the review. I followed all your other suggestions.

Zoltan.





More information about the reviews mailing list