[m-dev.] for review: fix shopstopper in intermod

Peter Ross peter.ross at miscrit.be
Fri Sep 8 21:35:30 AEDT 2000


Hi,

This change is required to allow the compiler to build.
I have no idea of its correctness.

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


Estimated hours taken: 0.5

intermod.m:
    Fix a bug which prevented the compiler from compiling.
    When resolving overloading check that the instance method definition
    that we are trying to resolve is a name before continuing.


Index: intermod.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/intermod.m,v
retrieving revision 1.81
diff -u -r1.81 intermod.m
--- intermod.m	2000/08/09 07:46:46	1.81
+++ intermod.m	2000/09/08 10:27:46
@@ -907,8 +907,14 @@
 	pred_info_arg_types(MethodCallPredInfo, MethodCallTVarSet, _,
 		MethodCallArgTypes),
 	InstanceMethod0 = instance_method(PredOrFunc, MethodName,
-			InstanceMethodName0, MethodArity, MethodContext),
+			InstanceMethodDefn0, MethodArity, MethodContext),
 	(
+		InstanceMethodDefn0 = name(InstanceMethodName0)
+	;
+		InstanceMethodDefn0 = clauses(_Clauses),
+		error("intermod__qualify_instance_method: should be a name.")
+	),
+	(
 		PredOrFunc = function,
 		module_info_get_predicate_table(ModuleInfo, PredicateTable),
 		(
@@ -935,8 +941,9 @@
 			MethodCallArgTypes, MethodCallTVarSet,
 			InstanceMethodName0, InstanceMethodName, PredId)
 	),
+	InstanceMethodDefn = name(InstanceMethodName),
 	InstanceMethod = instance_method(PredOrFunc, MethodName,
-			InstanceMethodName, MethodArity, MethodContext).
+			InstanceMethodDefn, MethodArity, MethodContext).
 
 %-----------------------------------------------------------------------------%
 
--------------------------------------------------------------------------
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