1.1 --- a/simplify/fixinstances.py Mon Jun 25 00:32:56 2007 +0200
1.2 +++ b/simplify/fixinstances.py Tue Jun 26 01:30:06 2007 +0200
1.3 @@ -208,16 +208,21 @@
1.4 return distinct_instances[value]
1.5
1.6 # For subprograms, find the distinct instance's copy for the owner
1.7 - # instance; otherwise, return the original subprogram.
1.8 + # instance and assert that the signatures are the same; otherwise,
1.9 + # return the original subprogram.
1.10 + # NOTE: This needs to be verified in a somewhat more formal fashion.
1.11
1.12 elif isinstance(value, Subprogram):
1.13 if hasattr(value, "copy_of") and hasattr(value, "instance"):
1.14 cls = value.instance.get_class()
1.15 distinct = cls.get_distinct_instances()
1.16 instance = distinct[value.instance]
1.17 - return value.copy_of.copies.get(instance, value)
1.18 - else:
1.19 - return value
1.20 + if value.copy_of.copies.has_key(instance):
1.21 + subprogram = value.copy_of.copies[instance]
1.22 + if subprogram.paramtypes == value.paramtypes:
1.23 + return subprogram
1.24 +
1.25 + return value
1.26
1.27 # Return all other values as they are.
1.28