[m-dev.] for review: superclass bug fix

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Oct 31 11:49:12 AEDT 2000


On 30-Oct-2000, David Glen Jeffery <dgj at students.cs.mu.oz.au> wrote:
> Fix a bug reported by petdr.
> 
> compiler/typecheck.m:
> 	When searching the superclass relation trying to reduce a constraint C, 
> 	we were holding all the variables in C as constant and allowing any
> 	others to be found. (The theory being that any other variables must be
> 	variables introduced during the search eg. by a multiparameter 
> 	typeclass that uses less than all of its parameters in one of its
> 	superclass constraint. These variables are effectively existentially
> 	quantified).
> 	However, this is not enough: variables from *other* assumed constraints
> 	must also not be bound, otherwise you risk binding the variables from
> 	another assumed constraint to the variables in C.
> 
> 	So... now we do not bind any of the head_type_params (which makes sense
> 	given that these are the variables that are universally quantified from
> 	the head or existentially quantified from the body).

That looks fine, thanks.

-- 
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-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