[m-rev.] diff: fix non-unique type_class_info names being generated

Peter Ross pro at missioncriticalit.com
Fri Jun 1 15:41:31 AEST 2007


Hi,


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


Estimated hours taken: 0.25
Branches: main

compiler/elds_to_erlang.m:
	type_info_to_string and pseudo_type_info_to_string generate
	the same name as the type_ctor_info when the type_infos
	are of zero arity, which leads to two distinct functions
	having the same name.
	Give type_infos and pseudo_type_infos distinct prefixes
	to avoid this problem.


Index: compiler/elds_to_erlang.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/elds_to_erlang.m,v
retrieving revision 1.8
diff -u -r1.8 elds_to_erlang.m
--- compiler/elds_to_erlang.m	1 Jun 2007 04:12:50 -0000	1.8
+++ compiler/elds_to_erlang.m	1 Jun 2007 05:38:03 -0000
@@ -531,7 +531,7 @@
 
             % TypeInfos are always local to the current module.
         InstanceModule = CurModuleName,
-        Atom = type_info_to_string(TypeInfo)
+        Atom = "ti_" ++ type_info_to_string(TypeInfo)
     ;
         RttiId = elds_rtti_pseudo_type_info_id(PseudoTypeInfo),
         ( PseudoTypeInfo = type_var(_) ->
@@ -542,7 +542,7 @@
             
             % PseudoTypeInfos are always local to the current module.
         InstanceModule = CurModuleName,
-        Atom = Prefix ++ pseudo_type_info_to_string(PseudoTypeInfo)
+        Atom = "pti_" ++ Prefix ++ pseudo_type_info_to_string(PseudoTypeInfo)
     ;
         RttiId = elds_rtti_base_typeclass_id(TCName, InstanceModule,
             InstanceStr),

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