[m-dev.] for review: improve typeclass error message
Tyson Dowd
trd at cs.mu.OZ.AU
Fri Nov 3 13:37:22 AEDT 2000
On 03-Nov-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Estimated hours taken: 0.75
>
> Improve the error message for errors in type class instance
> definitions that use the named (e.g. "pred(foo/N) is bar") syntax, as
> suggested by Ralph Becket: for such procedures, just output "in bar/N"
> rather than "in call to bar/N", since the user didn't write any
> explicit call.
>
> compiler/hlds_pred.m:
> Add a new marker `named_class_instance_method' to the pred_marker type.
>
> compiler/hlds_out.m:
> compiler/intermod.m:
> Handle the new marker.
>
> compiler/check_typeclass.m:
> For instance methods defined using the named syntax,
> add the `named_class_instance_method' marker to their markers.
>
> compiler/typecheck.m:
> compiler/mode_errors.m:
> Pass the pred_markers down to hlds_out__write_call_arg_id.
>
> compiler/hlds_out.m:
> Change hlds_out__write_call_arg_id so that for predicates with
> the `named_class_instance_method' marker, it doesn't output the
> "call to".
This looks good Fergus, but we should put a test case in the tests.
(Feel free to put that one on a to-do list somewhere).
--
Tyson Dowd #
# Surreal humour isn't everyone's cup of fur.
trd at cs.mu.oz.au #
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list