[m-rev.] for post-commit review: warn about the need for integer suffixes

Julien Fischer jfischer at opturion.com
Tue Jul 9 13:49:20 AEST 2019


On Sun, 7 Jul 2019, Zoltan Somogyi wrote:

> Warn about the absence of integer suffixes.

...

> diff --git a/compiler/typecheck.m b/compiler/typecheck.m
> index ea1b54dcb..00aab8226 100644
> --- a/compiler/typecheck.m
> +++ b/compiler/typecheck.m

...

> @@ -2105,8 +2104,7 @@ typecheck_var_has_type(GoalContext, Context, Var, Type,
>          TypeAssignSet0 = [_ | _]
>      then
>          TypeAssignSet = TypeAssignSet0,
> -        typecheck_info_get_error_clause_context(!.Info, ClauseContext),
> -        SpecAndMaybeActualExpected = report_error_var(ClauseContext,
> +        SpecAndMaybeActualExpected = report_error_var(!.Info,
>              GoalContext, Context, Var, Type, TypeAssignSet0),
>          SpecAndMaybeActualExpected = spec_and_maybe_actual_expected(Spec, _),
>          typecheck_info_add_error(Spec, !Info)
> @@ -2263,6 +2261,11 @@ typecheck_unify_var_functor(UnifyContext, Context, Var, ConsId, ArgVars,
>          GoalId, TypeAssignSet0, TypeAssignSet, !Info) :-
>      typecheck_info_get_error_clause_context(!.Info, ClauseContext),
>      ( if cons_id_must_be_builtin_type(ConsId, ConsType, BuiltinTypeName) then
> +        ( if BuiltinTypeName = "int" then

I would test against ConsType there rather than testing against the type name.

The diff looks fine otherwise.

Julien.


More information about the reviews mailing list