[m-rev.] for review: structured types in error messages

Peter Wang novalazy at gmail.com
Mon Feb 21 11:59:16 AEDT 2022


On Sun, 20 Feb 2022 02:08:14 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> Get type_to_pieces to generate structured output.
> 

> diff --git a/compiler/error_util.m b/compiler/error_util.m
> index 0bc5a1f83..557a5706a 100644
> --- a/compiler/error_util.m
> +++ b/compiler/error_util.m
...
>      ;
>          PorF = pf_function,
>          (
> -            ArgPieces = [],
> -            unexpected($pred, "function has no arguments")
> +            ArgPiecesList = [],
> +            unexpected($pred, "function has no return value")
>          ;
> -            ArgPieces = [ReturnValuePieces],
> -            ArgBlockPieces = [fixed("=")] ++
> +            ArgPiecesList = [ReturnValuePieces],
> +            PorFArgBlockPieces = [fixed("func"), fixed("=")] ++
>                  FuncResultPrefixPieces ++ ReturnValuePieces ++
>                  FuncResultSuffixPieces

"(func)" instead of "func".

The rest looks fine.

Peter


More information about the reviews mailing list