[m-dev.] diff: get rid of unnecessary tvars

David Glen JEFFERY dgj at cs.mu.OZ.AU
Tue Jun 23 14:52:03 AEST 1998


On 22-Jun-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 22-Jun-1998, David Glen JEFFERY <dgj at cs.mu.OZ.AU> wrote:
> > Get rid of unnecessary type variables when creating the auxiliary predicate
> > for an instance method. This avoids problems when typecheck.m gets rid of
> > unused tvars that it thinks were introduced by type inference.
> 
> What kind of problems?  Do you have a regression test?

Well... there's already a test case, I'm pretty sure. There's also already
a fix, but this change just makes things a little nicer. I've re-worded the
log message below.

> 
> > compiler/typecheck.m:
> >         Undo a previous change which used all the info from
> >         typecheck_get_final_info even if we were only checking the types.
> >         Call varset__squash to evict unnecessary tvars.
> 
> I didn't see any lines in the diff which would correspond to the
> first sentence above.

Um... I guess not. I think I must have dreamed that one. ;-) I *could* back
out that change if you think it's worth it. In any case, it can be a separate
commit.

------------------------------------------------------------------------------

Estimated hours taken: 3

Get rid of unnecessary type variables when creating the auxiliary predicate
for an instance method. This is a little more robust than the current
approach since typecheck.m is now able to get rid of any unused tvars... they
*must* have been introduced by type inference.

library/varset.m:
        Add a predicate varset__squash which gets rid of unused variables.

compiler/check_typeclass.m:
        Call varset__squash to get rid of the unnecessary tvars.

compiler/typecheck.m:
        Call varset__squash to get rid of the unnecessary tvars, rather than
	doing it "manually".

------------------------------------------------------------------------------

You've already got a copy of the diff.


love and cuddles,
dgj
-- 
David Jeffery (dgj at cs.mu.oz.au) |  Marge: Did you just call everyone "chicken"?
PhD student,                    |  Homer: Noooo.  I swear on this Bible!
Department of Computer Science  |  Marge: That's not a Bible; that's a book of
University of Melbourne         |         carpet samples!
Australia                       |  Homer: Ooooh... Fuzzy.



More information about the developers mailing list