1.1 --- a/micropython/data.py Wed Feb 29 00:39:20 2012 +0100
1.2 +++ b/micropython/data.py Mon Mar 05 00:25:11 2012 +0100
1.3 @@ -418,6 +418,7 @@
1.4 # Visit each user and examine the attribute usage for each name.
1.5
1.6 for user in self.all_attribute_users:
1.7 + user._attrtypes = self._deduce_types(user._attrcombined, objtable)
1.8 self._finalise_contributor(user, objtable)
1.9
1.10 def _finalise_contributor(self, node, objtable):
1.11 @@ -428,22 +429,26 @@
1.12 """
1.13
1.14 if not hasattr(node, "_attrtypes"):
1.15 - node._attrtypes = self._deduce_types(node, objtable)
1.16 -
1.17 - for contributor in node._attrcontributors:
1.18 - self._finalise_contributor(contributor, objtable)
1.19 -
1.20 - def _deduce_types(self, user, objtable):
1.21 + merged = {}
1.22 + for user in node._attrdefs:
1.23 + merged.update(user._attrnames)
1.24 + node._attrmerged = combine_mapping_dicts(deepen_mapping_dict(node._attrnames), deepen_mapping_dict(merged))
1.25 + node._attrtypes = self._deduce_types(node._attrmerged, objtable)
1.26 +
1.27 + for contributor in node._attrbranches:
1.28 + self._finalise_contributor(contributor, objtable)
1.29 +
1.30 + def _deduce_types(self, usage, objtable):
1.31
1.32 """
1.33 - Deduce the types for names using attributes on the given 'user' node
1.34 - using the given 'objtable'.
1.35 + Deduce the types for names from the given attribute 'usage' and using
1.36 + the given 'objtable'.
1.37 """
1.38
1.39 attrtypes = {}
1.40 - for name, usage in user._attrcombined.items():
1.41 - if usage is not None:
1.42 - attrtypes[name] = get_object_types_for_usage(usage, objtable, name, self.full_name())
1.43 + for name, combined_usage in usage.items():
1.44 + if combined_usage is not None:
1.45 + attrtypes[name] = get_object_types_for_usage(combined_usage, objtable, name, self.full_name())
1.46 return attrtypes
1.47
1.48 def get_usage_from_contributors(self, node):
1.49 @@ -600,6 +605,7 @@
1.50
1.51 if not hasattr(node, "_attrnames"):
1.52 node._attrnames = {}
1.53 + node._attrmerged = {}
1.54
1.55 # Branches contributing usage to this node.
1.56