[m-rev.] [for review] Add missing spaces to type ambiguity message

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Jan 6 16:23:01 AEDT 2012


Hi Michael,

On Thu, 5 Jan 2012, Michael Hendricks wrote:

> The compiler error about adding explicit type qualification was
> missing some spaces between words, making the resulting error message
> somewhat hard to understand.
>
> I split the "with_type" line into two lines because adding a trailing
> space caused the line to exceed 79 characters (per Mercury coding
> standards).
> ---
> compiler/typecheck_errors.m |   11 ++++++-----
> 1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/compiler/typecheck_errors.m b/compiler/typecheck_errors.m
> index da94fee..9bc0f6f 100644
> --- a/compiler/typecheck_errors.m
> +++ b/compiler/typecheck_errors.m
> @@ -1327,11 +1327,12 @@ report_ambiguity_error(Info, TypeAssign1, TypeAssign2) = Spec :-
> :- func add_qualifiers_reminder = string.
>
> add_qualifiers_reminder =
> -    "You will need to add an explicit type qualification" ++
> -    "to resolve the type ambiguity." ++
> -    "The way to add an explicit type qualification is to use ""with_type""." ++
> -    "For details see the ""Explicit type qualification"" sub-section" ++
> -    "of the ""Data-terms"" section of the ""Syntax"" chapter" ++
> +    "You will need to add an explicit type qualification " ++
> +    "to resolve the type ambiguity. " ++
> +    "The way to add an explicit type qualification " ++
> +    "is to use ""with_type"". " ++
> +    "For details see the ""Explicit type qualification"" sub-section " ++
> +    "of the ""Data-terms"" section of the ""Syntax"" chapter " ++
>     "of the Mercury language reference manual.".
>

Thanks for pointing this out - a better fix would be change the
function add_qualifiers_reminder return a list of 
error_util.format_components rather than a string.  That way
the usual error message formatting code can format it properly.
I have an alternative diff that does this that I will commit shortly.

Julien.

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list