[m-rev.] for post-commit review: fix Mantis bug 529
zoltan.somogyi at runbox.com
Thu Feb 25 11:24:12 AEDT 2021
2021-02-25 11:17 GMT+11:00 "Peter Wang" <novalazy at gmail.com>:
> Are you planning to do more work on the mode checker?
Yes, I am trying to make getopt work by specifying the modes
of the predicates stored in data structures in the types, not the
modes. The bug529 fix is not enough to make that possible,
since there are a bunch more places where the modechecker
needs to get higher order inst info out of types.
> I'm implementing
> my subtypes proposal and will be touching the type checker and mode
> checker this week and next week or so.
Just tell me when you are about to start work on the modechecker part.
I will then commit whatever I have that is commit ready, and give you
free rein until you are done.
> diff --git a/compiler/modecheck_call.m b/compiler/modecheck_call.m
> index f4678d884..628f1cf53 100644
> --- a/compiler/modecheck_call.m
> +++ b/compiler/modecheck_call.m
> @@ -412,8 +412,10 @@ modecheck_higher_order_call(PredOrFunc, PredVar, Args0, Args, Modes, Det,
> HOInstInfo = higher_order(PredInstInfo)
> - % If PredVar has no higher-order inst information, but is
> - % a function type, then assume the default function mode.
> + % If PredVarInst has no higher-order inst information,
> + % then look for higher-order inst information in the type.
> + % Otherwise, if PredVar has a function type, assume the default
> + % function mode.
> HOInstInfo = none_or_default_func,
> mode_info_get_var_types(!.ModeInfo, VarTypes),
> lookup_var_type(VarTypes, PredVar, Type),
Thanks for that.
More information about the reviews