[m-rev.] diff: fix construct_bug in erlang

Peter Wang novalazy at gmail.com
Fri Sep 21 14:09:23 AEST 2007


Estimated hours taken: 2
Branches: main

library/erlang_rtti_implementation.m:
	Collapse equivalence types in `num_functors' and
	`get_functor_with_names'.

Index: library/erlang_rtti_implementation.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/erlang_rtti_implementation.m,v
retrieving revision 1.26
diff -u -r1.26 erlang_rtti_implementation.m
--- library/erlang_rtti_implementation.m	21 Sep 2007 03:38:35 -0000	1.26
+++ library/erlang_rtti_implementation.m	21 Sep 2007 03:43:55 -0000
@@ -1164,8 +1164,11 @@
         TypeCtorRep = etcr_list,
         MaybeNumFunctors = yes(2)
     ;
+        TypeCtorRep = etcr_eqv,
+        EqvTypeInfo = collapse_equivalences(TypeInfo),
+        num_functors(EqvTypeInfo, MaybeNumFunctors)
+    ;
         ( TypeCtorRep = etcr_array
-        ; TypeCtorRep = etcr_eqv
         ; TypeCtorRep = etcr_int
         ; TypeCtorRep = etcr_float
         ; TypeCtorRep = etcr_char
@@ -1275,8 +1278,11 @@
             Result = no
         )
     ;
+        TypeCtorRep = etcr_eqv,
+        EqvTypeInfo = collapse_equivalences(TypeInfo),
+        Result = get_functor_with_names(EqvTypeInfo, NumFunctor)
+    ;
         ( TypeCtorRep = etcr_array
-        ; TypeCtorRep = etcr_eqv
         ; TypeCtorRep = etcr_int
         ; TypeCtorRep = etcr_float
         ; TypeCtorRep = etcr_char

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list