[m-rev.] for review: repeated type class constraints

Fergus Henderson fjh at cs.mu.OZ.AU
Wed May 23 22:16:13 AEST 2001


On 23-May-2001, David Jeffery <dgj at cs.mu.OZ.AU> wrote:
> Fix a bug reported by Nick Nethercote. The symptom is this bug was that
> the compiler aborted during the polymorphism transformation for predicate's
> whose type contained a repeated type class constraint.
>
> library/map.m:
> 	Add a new predicate map__set_from_corresponding lists which is like
> 	map__det_insert_from_corresponding_lists but uses map__set rather
> 	than map__det_insert. ie. it does not abort if a duplicate key
> 	is provided. Also add a pred map__set_from_assoc_list and function
> 	versions of these two new preds to be consistent with
> 	map__det_insert_from_corresponding_lists.
> 
> compiler/polymorphism.m:
> 	When building the initial type class info variable map, use
> 	map__set_from_corresponding rather than
> 	map__det_insert_from_corresponding_lists to take the case of repeated
> 	type class constraints into account.
> 
> tests/valid/Mmakefile:
> tests/valid/repeated_class_constraint.m:
> 	A test case for this.

That looks fine.

It would be nice to issue a warning for duplicate or redundant constraints,
but that's not a high priority.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list