[m-dev.] diff: bug fix for multi-param

David Glen JEFFERY dgj at cs.mu.OZ.AU
Thu Aug 26 17:08:57 AEST 1999


=============================================================================

Estimated hours taken: 0.5 
	(but much more trying to get the @#$%! debugger working!)

compiler/polymorphism.m:
	Rather that map__det_inserting the type info locations into the varmap,
	map__set them: a type info may appear in more than one location if
	the type variable appears more than once in a constraint.

tests/valid/typeclass_multi_repeat.m:
	A test case for this.
tests/valid/Mmakefile:
	Add the test case.

=============================================================================

cvs diff: Diffing compiler
Index: compiler/polymorphism.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/polymorphism.m,v
retrieving revision 1.168
diff -u -t -r1.168 polymorphism.m
--- polymorphism.m	1999/07/27 05:57:34	1.168
+++ polymorphism.m	1999/08/26 06:28:19
@@ -3170,7 +3170,7 @@
                                 LocnMap0::in, LocnMap::out] is det,
                 (
                         IndexedTypeVar = TheTypeVar - Location,
-                        map__det_insert(LocnMap0, TheTypeVar,
+                        map__set(LocnMap0, TheTypeVar,
                                 typeclass_info(Var, Location), LocnMap)
                 )),
         list__foldl(MakeEntry, NewClassTypeVars, TypeInfoMap0, TypeInfoMap1),
cvs diff: Diffing compiler/notes

Index: tests/valid/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/tests/valid/Mmakefile,v
retrieving revision 1.35
diff -u -t -r1.35 Mmakefile
--- Mmakefile	1999/06/09 16:39:47	1.35
+++ Mmakefile	1999/08/26 07:06:43
@@ -22,7 +22,8 @@
 TYPECLASS_SOURCES= \
         func_method.m \
         instance_superclass.m \
-        instance_unconstrained_tvar.m
+        instance_unconstrained_tvar.m \
+        typeclass_multi_repeat.m
 
 OTHER_SOURCES= \
         compl_unify_bug.m \

===================================================================

:- module typeclass_multi_repeat.
  
:- interface.
  
:- typeclass twin(A,B) where
[
pred twin_pred(A,B),
mode twin_pred(in,in) is semidet
].
  
:- pred p(T) <= twin(T,T).
:- mode p(in) is semidet.
  
:- implementation.

p(T):-
    twin_pred(T,T).

===================================================================



dgj
-- 
David Jeffery (dgj at cs.mu.oz.au) | If your thesis is utterly vacuous
PhD student,                    | Use first-order predicate calculus.
Dept. of Comp. Sci. & Soft. Eng.|     With sufficient formality
The University of Melbourne     |     The sheerist banality
Australia                       | Will be hailed by the critics: "Miraculous!"
                                |     -- Anon.
--------------------------------------------------------------------------
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